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>

public interface State<T> extends State<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 Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Represents the two players.
    static enum 
    Represents the status of the game.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the player who moves next.
    Returns the status of the game.
    boolean
    Returns whether the game is over.
    default boolean
    Returns whether the player specified has won the game.

    Methods inherited from interface common.State

    isLegalMove, makeMove
  • Method Details

    • getNextPlayer

      State.Player getNextPlayer()
      Returns the player who moves next.
      Returns:
      the player who moves next
    • isGameOver

      boolean isGameOver()
      Returns whether the game is over.
      Returns:
      whether the game is over
    • getStatus

      State.Status getStatus()
      Returns the status of the game.
      Returns:
      the status of the game
    • isWinner

      default boolean isWinner(State.Player player)
      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