Interface State<T>
- Type Parameters:
T
- represents the moves that can be applied to the states
- All Superinterfaces:
State<T>
- All Known Subinterfaces:
TwoPhaseMoveState<T>
Represents the state of a two-player game whose moves are described by a
single object. From a user interface-centric viewpoint, it is suitable for
games whose moves can be specified with a single selection, such as a single
mouse click.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Represents the two players.static enum
Represents the status of the game. -
Method Summary
Modifier and TypeMethodDescriptionReturns the player who moves next.Returns the status of the game.boolean
Returns whether the game is over.default boolean
isWinner
(State.Player player) Returns whether the player specified has won the game.Methods inherited from interface common.State
isLegalMove, makeMove
-
Method Details
-
getNextPlayer
-
isGameOver
boolean isGameOver()Returns whether the game is over.- Returns:
- whether the game is over
-
getStatus
-
isWinner
Returns whether the player specified has won the game.- Parameters:
player
- the player to be tested for win- Returns:
- whether the player specified has won the game
-