Class DiscountBehaviour

java.lang.Object
it.polimi.ingsw.model.leadercard.CardBehaviour
it.polimi.ingsw.model.leadercard.DiscountBehaviour

public class DiscountBehaviour
extends CardBehaviour
The CardBehaviour that represents the discount behaviour: a leader card with this behaviour will reduce the develop card price
  • Constructor Summary

    Constructors
    Constructor Description
    DiscountBehaviour​(ResourceType resourceToDiscount)  
  • Method Summary

    Modifier and Type Method Description
    void discount​(java.util.HashMap<ResourceType,​java.lang.Integer> resources)
    applies discount to the map passed as a parameter NOTE: the method modifies the map passed as a parameter in order to apply the discount does nothing if the card doesn't have this ability
    ResourceType getResourceToDiscount()  

    Methods inherited from class it.polimi.ingsw.model.leadercard.CardBehaviour

    createStorage, getOnWhite, getProductionRequirement, getResToStore, produce

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DiscountBehaviour

      public DiscountBehaviour​(ResourceType resourceToDiscount)
  • Method Details

    • discount

      public void discount​(java.util.HashMap<ResourceType,​java.lang.Integer> resources)
      Description copied from class: CardBehaviour
      applies discount to the map passed as a parameter NOTE: the method modifies the map passed as a parameter in order to apply the discount does nothing if the card doesn't have this ability
      Overrides:
      discount in class CardBehaviour
      Parameters:
      resources - the resource map to be discounted
    • getResourceToDiscount

      public ResourceType getResourceToDiscount()
      Overrides:
      getResourceToDiscount in class CardBehaviour