Class ResourceCostComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.infrastructure.ResourceCostComponent
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.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionResourceCostComponent
(int gold) Resource Cost Component constructor for objects which only cost gold.ResourceCostComponent
(int stone, int wood) Resource Cost Component with parameters for only stone and wood.ResourceCostComponent
(int gold, int stone, int wood) Resource Cost Component with extra parameters for stone and wood. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the entity's gold costint
Returns the entity's stone costint
Returns the entity's wood costMethods inherited from class com.deco2800.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
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
-