Class ResourceStatsComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.worker.components.WorkerInventoryComponent
com.deco2800.game.worker.components.ResourceStatsComponent
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
collectMetal
(CollectStatsComponent collector) int
collectStone
(CollectStatsComponent collector) Collects stoneint
collectWood
(CollectStatsComponent collector) Collects stoneisDead()
Returns true if the entity has 0 wood and 0 stone and 0 metal, otherwise false.Methods inherited from class com.deco2800.game.worker.components.WorkerInventoryComponent
addMetal, addStone, addWood, getMetal, getStone, getWood, hasMetal, hasStone, hasWood, setMetal, setStone, setWood, unloadMetal, unloadStone, unloadWood
Methods inherited from class com.deco2800.game.components.Component
create, dispose, earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
ResourceStatsComponent
public ResourceStatsComponent(int wood, int stone, int metal)
-
-
Method Details
-
isDead
Returns true if the entity has 0 wood and 0 stone and 0 metal, otherwise false.- Returns:
- is resource dead
-
collectStone
Collects stone -
collectWood
Collects stone -
collectMetal
-