Package it.polimi.ingsw.model
Class DevelopCard
java.lang.Object
it.polimi.ingsw.model.DevelopCard
public class DevelopCard
extends java.lang.Object
Represents a develop card
-
Constructor Summary
Constructors Constructor Description DevelopCard(CardFlag cardFlag, java.util.Map<ResourceType,java.lang.Integer> cost, java.util.Map<ResourceType,java.lang.Integer> requirement, java.util.Map<ResourceType,java.lang.Integer> product, int victoryPoints) -
Method Summary
Modifier and Type Method Description voidbuy(InterfacePlayerBoard playerBoard, int cardSlotNumber)handles the buying operation from start to finish.booleanequals(java.lang.Object obj)CardFlaggetCardFlag()intgetCardId()java.util.HashMap<ResourceType,java.lang.Integer>getCost()java.lang.StringgetImage()java.util.HashMap<ResourceType,java.lang.Integer>getProduct()java.util.HashMap<ResourceType,java.lang.Integer>getRequirement()intgetVictoryPoints()booleanisActivatable(InterfacePlayerBoard playerBoard)Checks if the player passed as a parameter can activate the card (this)booleanisBuyable(InterfacePlayerBoard playerBoard)Checks if the player passed as a parameter can buy the card (this)voidproduce(InterfacePlayerBoard playerBoard)activate the card productionMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DevelopCard
public DevelopCard(CardFlag cardFlag, java.util.Map<ResourceType,java.lang.Integer> cost, java.util.Map<ResourceType,java.lang.Integer> requirement, java.util.Map<ResourceType,java.lang.Integer> product, int victoryPoints)
-
-
Method Details
-
isBuyable
Checks if the player passed as a parameter can buy the card (this)- Parameters:
playerBoard- that wants to know if he can buy the card- Returns:
- true if the card can be bought, false otherwise
-
isActivatable
Checks if the player passed as a parameter can activate the card (this)- Parameters:
playerBoard- that wants to know if he can activate the card- Returns:
- true if the card can be activated, false if it can't
-
buy
public void buy(InterfacePlayerBoard playerBoard, int cardSlotNumber) throws NotBuyableException, InvalidCardSlotExceptionhandles the buying operation from start to finish. Removes the resources from the Player's warehouse and adds the new card to the specified CardSlot- Parameters:
playerBoard- that wants to buy the cardcardSlotNumber- number of the slot to put the new card in. (starts at 0)- Throws:
NotBuyableException- if the card can't be boughtInvalidCardSlotException- if the card cannot be placed in the specified slot or the slot doesn't exists
-
produce
activate the card production- Parameters:
playerBoard- that wants to activate the card- Throws:
NotActivatableException- if the card is not activatable by the specified player
-
getImage
public java.lang.String getImage() -
getCost
-
getRequirement
-
getProduct
-
getCardFlag
-
getVictoryPoints
public int getVictoryPoints() -
getCardId
public int getCardId() -
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-