Package rea.gaming

Class Player

java.lang.Object
rea.gaming.Player

public class Player extends Object
A player in a game instance. Every player is associated to a character and identified by its UUID, for security purposes. An instance of this class is returned when a character is added to the game. and it is used to identify the character in the game.
Author:
José Paulo Leal jpleal@fc.up.pt
See Also:
  • Constructor Details

    • Player

      public Player(Character character)
      Create a player with a character.
      Parameters:
      character - the character to be associated with the player
      Implementation Note:
      the player is identified by the UUID of the character's name which can be created using UUID.nameUUIDFromBytes(byte[])}.
  • Method Details

    • getCharacter

      public Character getCharacter()
      Get the character associated with this player
      Returns:
      the player's character
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object