Class PlayerState

java.lang.Object
net.royalur.model.PlayerState

public class PlayerState extends Object
A player state represents the state of a single player at a point in the game. This includes the player's score and number of pieces left to play.
  • Constructor Details

    • PlayerState

      public PlayerState(PlayerType player, int pieceCount, int score)
      Instantiates a state for a player in a game.
      Parameters:
      player - The player that this state represents.
      pieceCount - The number of pieces that the player has available to introduce to the board.
      score - The number of pieces that the player has taken off the board.
  • Method Details

    • getPlayer

      public PlayerType getPlayer()
      Gets the player that this state represents.
      Returns:
      The player that this state represents.
    • getPieceCount

      public int getPieceCount()
      Gets the number of pieces that the player has available to introduce to the board.
      Returns:
      The number of pieces that the player has available to introduce to the board.
    • getScore

      public int getScore()
      Gets the number of pieces that the player has taken off the board.
      Returns:
      The number of pieces that the player has taken off the board.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object