Class LadderGamePlayer

java.lang.Object
edu.ntnu.idi.idatt.model.player.Player
edu.ntnu.idi.idatt.model.player.LadderGamePlayer

public class LadderGamePlayer extends Player
LadderGamePlayer.

Represents a player specifically in a Ladder Game. This class extends the general Player class and adds functionality relevant to ladder games, primarily tracking the player's current LadderGameTile on the board.

See Also:
  • Constructor Details

    • LadderGamePlayer

      public LadderGamePlayer(String name, String colorHex, PlayerTokenType playerTokenType, boolean isBot)
      Constructs a new LadderGamePlayer.
      Parameters:
      name - The name of the player.
      colorHex - The hexadecimal string representation of the player's color.
      playerTokenType - The PlayerTokenType chosen by the player.
      isBot - A boolean indicating whether this player is a bot (AI-controlled).
  • Method Details

    • getCurrentTile

      public Tile getCurrentTile()
      Returns the LadderGameTile the player is currently on.
      Returns:
      The current LadderGameTile of the player, or null if not yet placed.
    • placeOnTile

      public void placeOnTile(Tile tile)
      Places the player on the specified Tile. The tile is validated to ensure it is a LadderGameTile and not null.
      Parameters:
      tile - The Tile (must be a LadderGameTile) to place the player on.
      Throws:
      IllegalArgumentException - if the provided tile is null or not an instance of LadderGameTile.