Class CollectStatsComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.worker.components.CollectStatsComponent
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCollectionAmount
(int collectionAmount) Adds to the amount which an entity can collect.int
Returns the amount which entity can collect.void
setCollectionAmount
(int collectionAmount) Sets the entity's collection amount.Methods inherited from class com.deco2800.game.components.Component
create, dispose, earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
CollectStatsComponent
public CollectStatsComponent(int collectionAmount)
-
-
Method Details
-
getCollectionAmount
public int getCollectionAmount()Returns the amount which entity can collect.- Returns:
- amount to collect
-
setCollectionAmount
public void setCollectionAmount(int collectionAmount) Sets the entity's collection amount. Collection amount has a minimum bound of 0.- Parameters:
collectionAmount
- collection amount
-
addCollectionAmount
public void addCollectionAmount(int collectionAmount) Adds to the amount which an entity can collect. The amount added can be negative.- Parameters:
collectionAmount
- collection amount to add
-