Package com.csse3200.game.components
Class CostComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.CostComponent
Component used to store information related to cost.
Any entities that necessitate a cost should register an instance of this class.
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
CostComponent
public CostComponent(int cost)
-
-
Method Details
-
setCost
public void setCost(int cost) Sets the entity's cost. Cost has a minimum bound of 0.- Parameters:
cost
-
-
getCost
public int getCost()Returns the entity's cost- Returns:
- entity's cost
-