Class DevelopCard

java.lang.Object
it.polimi.ingsw.model.DevelopCard

public class DevelopCard
extends java.lang.Object
Represents a develop card
  • 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

      public boolean isBuyable​(InterfacePlayerBoard playerBoard)
      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

      public boolean isActivatable​(InterfacePlayerBoard playerBoard)
      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, InvalidCardSlotException
      handles 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 card
      cardSlotNumber - number of the slot to put the new card in. (starts at 0)
      Throws:
      NotBuyableException - if the card can't be bought
      InvalidCardSlotException - if the card cannot be placed in the specified slot or the slot doesn't exists
    • produce

      public void produce​(InterfacePlayerBoard playerBoard) throws NotActivatableException
      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

      public java.util.HashMap<ResourceType,​java.lang.Integer> getCost()
    • getRequirement

      public java.util.HashMap<ResourceType,​java.lang.Integer> getRequirement()
    • getProduct

      public java.util.HashMap<ResourceType,​java.lang.Integer> getProduct()
    • getCardFlag

      public CardFlag getCardFlag()
    • getVictoryPoints

      public int getVictoryPoints()
    • getCardId

      public int getCardId()
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object