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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckForCoins(Color color) booleanbooleanintgetCoins()A getter for the number of coins for aPlayer's object.getDeck()A getter for theAssistantCardheld in the hand by aPlayer.A getter for theSchoolBoarddining room of aPlayer's object.A getter for theSchoolBoardentrance of aPlayer's object.intA 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 theTowerColorof aPlayer's object.intA getter for theWizardof aPlayer's object.inthashCode()voidplayAssistantCard(AssistantCard playedCard) A method to implement the act of playing anAssistantCardfrom the hand.booleanvoidsetMotherNatureMovements(int movements) A setter for the number of allowed Mother Nature's movements for aPlayer's object during the current turn.voidsetTowerColor(TowerColor towerColor) A setter for theTowerColorof aPlayer's object.voidA setter for theWizardof aPlayer's object.voidupdateCoins(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 theAssistantCardheld in the hand by aPlayer.- Returns:
- the reference to a
Listcontaining thePlayer's cards
-
getEntrance
A getter for theSchoolBoardentrance of aPlayer's object.- Returns:
- the reference to the
Player'sSchoolBoardentrance
-
getDiningRoom
A getter for theSchoolBoarddining room of aPlayer's object.- Returns:
- the reference to the
Player'sSchoolBoarddining room
-
getTowerColor
A getter for theTowerColorof aPlayer's object.- Returns:
- the internal state for a
Player'sTowerColor
-
setTowerColor
A setter for theTowerColorof aPlayer's object.- Parameters:
towerColor- the new internal state for aPlayer'sTowerColor
-
getWizard
A getter for theWizardof aPlayer's object.- Returns:
- the internal state for a
Player'sWizard
-
setWizard
A setter for theWizardof aPlayer's object.- Parameters:
wizard- the new internal state for aPlayer'sWizard
-
deployTower
public boolean deployTower()- Returns:
trueif and only if thisSchoolBoardcan deploy an additional tower- See Also:
-
returnTower
public boolean returnTower()- Returns:
trueif and only if thisSchoolBoardcan contain an additional tower- See Also:
-
getTowerQuantity
public int getTowerQuantity()- Returns:
- the number of towers which the
Playerowns 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 anAssistantCardfrom the hand.- Parameters:
playedCard- the card which thePlayerwants to play
-
checkForCoins
- Parameters:
color- theColorwhose amount of students is checked- Returns:
trueif and only if thePlayerwho owns thisDiningRoomis entitled to receive a coin based on the number of students of colorcolortheirDiningRoomcontains- 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()
-