|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectGame
public class Game
A game object is responsible for keeping track of the exact state of the game, for updating the state of the game once both players have reported their moves, and for making callbacks to the GameServer once both player moves have been reported and the game advances to a new move.
| Constructor Summary | |
|---|---|
Game()
Creates a Game object (which keeps track of a rock-paper-scissors match). |
|
| Method Summary | |
|---|---|
void |
makeMove(GameServer server,
int playerNumber,
long moveNumber,
Move move)
This method, called by GameServer, indicates that the given player has committed to the given move, for the given moveNumber. |
void |
startGame(GameServer server)
Called by the server to start the game. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Game()
| Method Detail |
|---|
public void startGame(GameServer server)
server - reference to the GameServer object, used for callback to moveAvailable.
public void makeMove(GameServer server,
int playerNumber,
long moveNumber,
Move move)
server - the GameServer to make the moveAvailable callback to.playerNumber - the ID number of the player making the move.moveNumber - the serial number of the game move for which a move is being reported.move - the move to make in the game. Cannot be null.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||