Class IngredientComponent


public class IngredientComponent extends ItemComponent
  • Constructor Details

    • IngredientComponent

      public IngredientComponent(String itemName, ItemType itemType, int weight, int cookTime, int chopTime, String itemState)
      Constructs an IngredientComponent with the specified attributes. Initialises the required variables, determining specific actions that can be used on an ingredient.
      Parameters:
      itemName - - a string which is the name of the ingredient
      itemType - - an ItemType which is the type of the item
      weight - - an integer which is the weight of the ingredient
      cookTime - - an integer which is the time taken to cook the item
      chopTime - - an integer which is the time taken to chop the item
      itemState - - a string which is the current state of the item
  • Method Details

    • getCookTime

      public int getCookTime()
      Returns the cook time value
      Returns:
      an integer which is the required cook time
    • getChopTime

      public int getChopTime()
      Returns the chop time value
      Returns:
      an integer which is the required chop time
    • getItemState

      public String getItemState()
      Returns the Item state
      Returns:
      a string which is the current state of the item
    • getIsCookable

      public boolean getIsCookable()
      Returns whether the ingredient can be cooked
      Returns:
      a boolean that indicates whether an ingredient can be cooked
    • getIsChoppable

      public boolean getIsChoppable()
      Returns whether the ingredient can be chopped
      Returns:
      a boolean that indicates whether an ingredient can be chopped
    • cookItem

      public void cookItem()
      Set the item state to cooked
    • burnItem

      public void burnItem()
      Set the item state to burned
    • chopItem

      public void chopItem()
      Set the item state to chopped
    • setItemState

      public void setItemState(String itemState)
    • rawItem

      public void rawItem()
      Set the item state to raw