nl.bluering.ppracing
Class Game
java.lang.Object
|
+--nl.bluering.ppracing.Game
- public class Game
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Game
public Game(Ppracing p)
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 humanname
- 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)