Class ChopIngredientComponent


public class ChopIngredientComponent extends ItemTimerComponent
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.
  • 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
      Overrides:
      create in class Component
    • update

      public void update()
      update is called on each frame
      Overrides:
      update in class ItemTimerComponent
    • updateItem

      protected void updateItem()
      Update the item component to reflect its new state. Should not be manually calleds
      Specified by:
      updateItem in class ItemTimerComponent
    • getIsChopping

      public boolean getIsChopping()
      Get if the item is currently cooking
      Returns:
      true if the item is cooking, false otherwise.