Package it.polimi.ingsw.eriantys.model
Class Player
java.lang.Object
it.polimi.ingsw.eriantys.model.Player
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkForCoins
(Color color) boolean
boolean
int
getCoins()
A getter for the number of coins for aPlayer
's object.getDeck()
A getter for theAssistantCard
held in the hand by aPlayer
.A getter for theSchoolBoard
dining room of aPlayer
's object.A getter for theSchoolBoard
entrance of aPlayer
's object.int
A getter for the number of allowed Mother Nature's movements for aPlayer
's object during the current turn.A getter for the nickname of aPlayer
's object.A getter for theTowerColor
of aPlayer
's object.int
A getter for theWizard
of aPlayer
's object.int
hashCode()
void
playAssistantCard
(AssistantCard playedCard) A method to implement the act of playing anAssistantCard
from the hand.boolean
void
setMotherNatureMovements
(int movements) A setter for the number of allowed Mother Nature's movements for aPlayer
's object during the current turn.void
setTowerColor
(TowerColor towerColor) A setter for theTowerColor
of aPlayer
's object.void
A setter for theWizard
of aPlayer
's object.void
updateCoins
(int amount) A method to assign a variable quantity of coins to aPlayer
.
-
Constructor Details
-
Player
-
-
Method Details
-
getNickname
A getter for the nickname of aPlayer
's object.- Returns:
- the internal state for a
Player
's nickname
-
getDeck
A getter for theAssistantCard
held in the hand by aPlayer
.- Returns:
- the reference to a
List
containing thePlayer
's cards
-
getEntrance
A getter for theSchoolBoard
entrance of aPlayer
's object.- Returns:
- the reference to the
Player
'sSchoolBoard
entrance
-
getDiningRoom
A getter for theSchoolBoard
dining room of aPlayer
's object.- Returns:
- the reference to the
Player
'sSchoolBoard
dining room
-
getTowerColor
A getter for theTowerColor
of aPlayer
's object.- Returns:
- the internal state for a
Player
'sTowerColor
-
setTowerColor
A setter for theTowerColor
of aPlayer
's object.- Parameters:
towerColor
- the new internal state for aPlayer
'sTowerColor
-
getWizard
A getter for theWizard
of aPlayer
's object.- Returns:
- the internal state for a
Player
'sWizard
-
setWizard
A setter for theWizard
of aPlayer
's object.- Parameters:
wizard
- the new internal state for aPlayer
'sWizard
-
deployTower
public boolean deployTower()- Returns:
true
if and only if thisSchoolBoard
can deploy an additional tower- See Also:
-
returnTower
public boolean returnTower()- Returns:
true
if and only if thisSchoolBoard
can contain an additional tower- See Also:
-
getTowerQuantity
public int getTowerQuantity()- Returns:
- the number of towers which the
Player
owns in theSchoolBoard
- See Also:
-
getMotherNatureMovements
public int getMotherNatureMovements()A getter for the number of allowed Mother Nature's movements for aPlayer
's object during the current turn.- Returns:
- the internal state for the number of allowed Mother Nature's movements of a
Player
-
setMotherNatureMovements
A setter for the number of allowed Mother Nature's movements for aPlayer
's object during the current turn.- Parameters:
movements
- the new internal state for the number of allowed Mother Nature's movements of aPlayer
- 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 aPlayer
's object.- Returns:
- the internal state for the number of coins of a
Player
-
playAssistantCard
A method to implement the act of playing anAssistantCard
from the hand.- Parameters:
playedCard
- the card which thePlayer
wants to play
-
checkForCoins
- Parameters:
color
- theColor
whose amount of students is checked- Returns:
true
if and only if thePlayer
who owns thisDiningRoom
is entitled to receive a coin based on the number of students of colorcolor
theirDiningRoom
contains- See Also:
-
updateCoins
public void updateCoins(int amount) A method to assign a variable quantity of coins to aPlayer
.- Parameters:
amount
- the number of coins (could be negative) to be assigned to thePlayer
-
equals
-
hashCode
public int hashCode()
-