nl.bluering.ppracing
Class Game

java.lang.Object
  |
  +--nl.bluering.ppracing.Game

public class Game
extends java.lang.Object


Constructor Summary
Game(Ppracing p)
           
 
Method Summary
 Player currentplayer()
           
 boolean finished()
           
 Circuit getcirc()
           
 int getgridsize()
           
 Player getplayer(int i)
           
 int getplayercount()
           
 boolean isnetgame()
           
 boolean isserver()
           
 void newgame(int[] type, java.lang.String[] name)
          This method is called to start a new game
 void newnetgame(NetClient n)
          Starts a new game with this player as client
 void newnetgame(NetSClient n)
          Starts a new game with this player as server
 void nextplayer()
          Shifts the turn to the next player
 boolean onturn()
           
 void sendmove(int i)
           
 int startpos(int i)
           
 void takeover(int id)
           
 void undo()
          this method undoes a move, if possible.
 void win()
          This checks if there is a winner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Game

public Game(Ppracing p)
Method Detail

newgame

public void newgame(int[] type,
                    java.lang.String[] name)
This method is called to start a new game
Parameters:
ai - Array with value 'true' for computer player and 'false' for human
name - Array with the names of the players

nextplayer

public void nextplayer()
Shifts the turn to the next player

newnetgame

public void newnetgame(NetClient n)
Starts a new game with this player as client

newnetgame

public void newnetgame(NetSClient n)
Starts a new game with this player as server

sendmove

public void sendmove(int i)

isnetgame

public boolean isnetgame()

isserver

public boolean isserver()

onturn

public boolean onturn()

takeover

public void takeover(int id)

win

public void win()
This checks if there is a winner. If so, it stops the game and makes an anouncement

finished

public boolean finished()
Returns:
True if the game has ended

getgridsize

public int getgridsize()
Returns:
The size of the grid

getcirc

public Circuit getcirc()
Returns:
The current circuit

getplayercount

public int getplayercount()
Returns:
the number of players

getplayer

public Player getplayer(int i)
Parameters:
i - Index of the player requested
Returns:
The requested player

currentplayer

public Player currentplayer()
Returns:
The current player

undo

public void undo()
this method undoes a move, if possible.

startpos

public int startpos(int i)