Class GameState

java.lang.Object
  extended by GameState
All Implemented Interfaces:
java.io.Serializable

public class GameState
extends java.lang.Object
implements java.io.Serializable

An object encapsulating the state of the game at the beginning of a game move.

See Also:
Serialized Form

Constructor Summary
GameState(int p1, int p2)
          Creates a game object representing the state of the game, which consists of the result from the previous round.
 
Method Summary
 int player1Type()
          Returns the type that player 1 used on the previous move.
 int player2Type()
          Returns the type that player 2 used on the previous move.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameState

public GameState(int p1,
                 int p2)
Creates a game object representing the state of the game, which consists of the result from the previous round.

Parameters:
p1 - the type of move player 1 just performed.
p2 - the type of move player 2 just performed.
Method Detail

player1Type

public int player1Type()
Returns the type that player 1 used on the previous move.

Returns:
either Move.ROCK, Move.PAPER, Move.SCISSORS, or Move.NONE.

player2Type

public int player2Type()
Returns the type that player 2 used on the previous move.

Returns:
either Move.ROCK, Move.PAPER, Move.SCISSORS, or Move.NONE.