Class ChopIngredientComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.items.ItemTimerComponent
com.csse3200.game.components.items.ChopIngredientComponent
The ChopIngredientComponent handles the chopping process for an ingredient in the game.
It manages the state of chopped, determines when the chopping is complete, and triggers
the appropriate actions based on the chopping status.
-
Field Summary
Fields inherited from class com.csse3200.game.components.items.ItemTimerComponent
elapsed, gameTime, isRunning, length
-
Constructor Summary
ConstructorsConstructorDescriptionChopIngredientComponent constructor, takes no parameters as the length of time that the timer goes for must be set manually. -
Method Summary
Methods inherited from class com.csse3200.game.components.items.ItemTimerComponent
getCompletionPercent, isFinished, rageModeOff, rageModeOn, setLength, startTimer, stopTimer
Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
ChopIngredientComponent
public ChopIngredientComponent()ChopIngredientComponent constructor, takes no parameters as the length of time that the timer goes for must be set manually.
-
-
Method Details
-
create
public void create()create is called when the entity is registered -
update
public void update()update is called on each frame- Overrides:
update
in classItemTimerComponent
-
updateItem
protected void updateItem()Update the item component to reflect its new state. Should not be manually calleds- Specified by:
updateItem
in classItemTimerComponent
-
getIsChopping
public boolean getIsChopping()Get if the item is currently cooking- Returns:
- true if the item is cooking, false otherwise.
-