Class Player

java.lang.Object
edu.ntnu.idi.idatt.model.player.Player
Direct Known Subclasses:
LadderGamePlayer, LudoPlayer

public abstract class Player extends Object
Player class

This class represents a player in the game. It contains a name, a color, a player token type, and the current tile of the player.

  • Constructor Details

    • Player

      public Player(String name, String colorHex, PlayerTokenType playerTokenType, boolean isBot)
      Constructor for Player class.
      Parameters:
      name - The name of the player.
      colorHex - The color of the player in hex format.
      playerTokenType - The type of player token to use for the player.
      isBot - Whether the player is a bot or not.
  • Method Details

    • getName

      public String getName()
      Returns the name of the player.
      Returns:
      The name of the player.
    • getColorHex

      public String getColorHex()
      Returns the color of the player in hex format.
      Returns:
      The color of the player in hex format.
    • getPlayerTokenType

      public PlayerTokenType getPlayerTokenType()
      Returns the type of player token to use for the player.
      Returns:
      the type of player token to use for the player
    • isBot

      public boolean isBot()
      Returns whether the player is a bot or not.
      Returns:
      true if the player is a bot, false otherwise.
    • setName

      public void setName(String name)
      Sets the name of the player.
      Parameters:
      name - The name to set.
    • setColorHex

      public void setColorHex(String colorHex)
      Sets the color of the player in hex format.
      Parameters:
      colorHex - The color to set.
    • setPlayerTokenType

      public void setPlayerTokenType(PlayerTokenType playerTokenType)
      Sets the type of player token to use for the player.
      Parameters:
      playerTokenType - the type of player token to use for the player
    • setBot

      public void setBot(boolean isBot)
      Sets whether the player is a bot or not.
      Parameters:
      isBot - Whether the player is a bot or not.