Class Player

java.lang.Object
it.polimi.ingsw.eriantys.model.Player

public class Player extends Object
A class which represents a human being playing the game. Its internal state contains all the game elements that are used and manipulated by the player.
  • Constructor Details

    • Player

      public Player(String nickname, int entranceSize, int towerNumber)
  • Method Details

    • getNickname

      public String getNickname()
      A getter for the nickname of a Player's object.
      Returns:
      the internal state for a Player's nickname
    • getDeck

      public List<AssistantCard> getDeck()
      A getter for the AssistantCard held in the hand by a Player.
      Returns:
      the reference to a List containing the Player's cards
    • getEntrance

      public StudentContainer getEntrance()
      A getter for the SchoolBoard entrance of a Player's object.
      Returns:
      the reference to the Player's SchoolBoard entrance
    • getDiningRoom

      public DiningRoom getDiningRoom()
      A getter for the SchoolBoard dining room of a Player's object.
      Returns:
      the reference to the Player's SchoolBoard dining room
    • getTowerColor

      public TowerColor getTowerColor()
      A getter for the TowerColor of a Player's object.
      Returns:
      the internal state for a Player's TowerColor
    • setTowerColor

      public void setTowerColor(TowerColor towerColor)
      A setter for the TowerColor of a Player's object.
      Parameters:
      towerColor - the new internal state for a Player's TowerColor
    • getWizard

      public Wizard getWizard()
      A getter for the Wizard of a Player's object.
      Returns:
      the internal state for a Player's Wizard
    • setWizard

      public void setWizard(Wizard wizard)
      A setter for the Wizard of a Player's object.
      Parameters:
      wizard - the new internal state for a Player's Wizard
    • deployTower

      public boolean deployTower()
      Returns:
      true if and only if this SchoolBoard can deploy an additional tower
      See Also:
    • returnTower

      public boolean returnTower()
      Returns:
      true if and only if this SchoolBoard can contain an additional tower
      See Also:
    • getTowerQuantity

      public int getTowerQuantity()
      Returns:
      the number of towers which the Player owns in the SchoolBoard
      See Also:
    • getMotherNatureMovements

      public int getMotherNatureMovements()
      A getter for the number of allowed Mother Nature's movements for a Player's object during the current turn.
      Returns:
      the internal state for the number of allowed Mother Nature's movements of a Player
    • setMotherNatureMovements

      public void setMotherNatureMovements(int movements) throws InvalidArgumentException
      A setter for the number of allowed Mother Nature's movements for a Player's object during the current turn.
      Parameters:
      movements - the new internal state for the number of allowed Mother Nature's movements of a Player
      Throws:
      InvalidArgumentException - if the passed parameter is less than or equal to zero
    • getCoins

      public int getCoins()
      A getter for the number of coins for a Player's object.
      Returns:
      the internal state for the number of coins of a Player
    • playAssistantCard

      public void playAssistantCard(AssistantCard playedCard)
      A method to implement the act of playing an AssistantCard from the hand.
      Parameters:
      playedCard - the card which the Player wants to play
    • checkForCoins

      public boolean checkForCoins(Color color)
      Parameters:
      color - the Color whose amount of students is checked
      Returns:
      true if and only if the Player who owns this DiningRoom is entitled to receive a coin based on the number of students of color color their DiningRoom contains
      See Also:
    • updateCoins

      public void updateCoins(int amount)
      A method to assign a variable quantity of coins to a Player.
      Parameters:
      amount - the number of coins (could be negative) to be assigned to the Player
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object