java.lang.Object
polimi.ingsw.am21.codex.model.Player.Player

public class Player extends Object
  • Method Details

    • getConnectionID

      public UUID getConnectionID()
    • getNickname

      public String getNickname()
      Returns:
      player's nickname
    • getBoard

      public PlayerBoard getBoard()
      Returns:
      player's board
    • getToken

      public TokenColor getToken()
      Returns:
      player's token
    • getPoints

      public int getPoints()
      Returns:
      player's points
    • drawCard

      public void drawCard(PlayableCard card)
      Parameters:
      card - drawn from the GameBoard which is added to the players hand
    • placeCard

      public PlayableCard placeCard(int cardIndex, CardSideType side, Position position) throws InvalidActionException, AlreadyPlacedCardGameException
      Asks the PlayerBoard to position the card and then evaluates it
      Parameters:
      cardIndex - of the card chosen from the player's hand,
      side - of the card chosen to be placed on the PlayerBoard
      position - of the PlayerBoard in which the card will be placed by the PlayerBoard
      Throws:
      IndexOutOfBoundsException - if the index provided exceeds the player
      IllegalCardSideChoiceException - if the side chosen is not placeable because of the side placing condition
      IllegalPlacingPositionException - if the position provided is either unreachable, occupied or forbidden
      InvalidActionException
      AlreadyPlacedCardGameException
    • evaluate

      public void evaluate(ObjectiveCard objectiveCard)
      Uses the PlayerBoard to evaluate the points of the objective card passed as argument adds the point to the player score.
      Parameters:
      objectiveCard - to be evaluated at the end of the game
    • evaluateSecretObjective

      public void evaluateSecretObjective()
      Evaluates the player secret objective, called by the Game class when Game overs
    • getCardPlaced

      public Boolean getCardPlaced()
    • resetCardPlaced

      public void resetCardPlaced()