Class CookIngredientComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.items.ItemTimerComponent
com.csse3200.game.components.items.CookIngredientComponent
The CookIngredientComponent handles the cooking process for an ingredient in the game.
It manages the state of cooking, determines when the cooking is complete, and triggers
the appropriate actions based on the cooking status and the station's state.
-
Field Summary
Fields inherited from class com.csse3200.game.components.items.ItemTimerComponent
elapsed, gameTime, isRunning, length
-
Constructor Summary
ConstructorsConstructorDescriptionCookIngredientComponent 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
-
CookIngredientComponent
public CookIngredientComponent()CookIngredientComponent constructor, takes no parameters as the length of time that the timer goes for must be set manually.
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. -
update
public void update()Description copied from class:ItemTimerComponent
Function to run each frame- Overrides:
update
in classItemTimerComponent
-
updateItem
protected void updateItem()Update the item component to reflect its new state.- Specified by:
updateItem
in classItemTimerComponent
-
getIsCooking
public boolean getIsCooking()Get if the item is currently cooking- Returns:
- true if the item is cooking, false otherwise.
-