Class PlayerLobby

java.lang.Object
it.polimi.ingsw.am13.model.player.PlayerLobby
All Implemented Interfaces:
Serializable

public final class PlayerLobby extends Object implements Serializable
Immutable class representing a player not yet in game. It stores only the information about nickname and token chosen. 2 objects of this class are equals iff they have same nickname and color of token
See Also:
  • Field Details

    • nickname

      private final String nickname
      Player's nickname.
    • token

      private final Token token
      Player's token (indicates their color).
  • Constructor Details

    • PlayerLobby

      public PlayerLobby(String nickname, Token token)
      Parameters:
      nickname - Nickname of the player
      token - Token chosen by the player
    • PlayerLobby

      public PlayerLobby(String nickname, ColorToken colorToken)
      Parameters:
      nickname - Nickname of the player
      colorToken - Color of the token chosen by the player
  • Method Details

    • getNickname

      public String getNickname()
      Returns:
      Player's nickname.
    • getToken

      public Token getToken()
      Returns:
      Player's token (indicates their color).
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object