Class ResourceCostComponent

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.infrastructure.ResourceCostComponent

public class ResourceCostComponent extends Component
Component used to store information related to the cost of different structures: gold, stone etc. Any structures which have an associated cost should have an instance of this class registered.
  • Constructor Details

    • ResourceCostComponent

      public ResourceCostComponent(int gold)
      Resource Cost Component constructor for objects which only cost gold. Gold has a minimum value of 0
      Parameters:
      gold -
    • ResourceCostComponent

      public ResourceCostComponent(int gold, int stone, int wood)
      Resource Cost Component with extra parameters for stone and wood. All three parameters have a minimum value of 0
      Parameters:
      gold -
      stone -
      wood -
    • ResourceCostComponent

      public ResourceCostComponent(int stone, int wood)
      Resource Cost Component with parameters for only stone and wood. Both parameters have a minimum value of 0
      Parameters:
      stone -
      wood -
  • Method Details

    • getGoldCost

      public int getGoldCost()
      Returns the entity's gold cost
      Returns:
      int
    • getStoneCost

      public int getStoneCost()
      Returns the entity's stone cost
      Returns:
      int
    • getWoodCost

      public int getWoodCost()
      Returns the entity's wood cost
      Returns:
      int