Class ItemComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.items.ItemComponent
Direct Known Subclasses:
IngredientComponent, MealComponent, PlateComponent

public class ItemComponent extends Component
  • Constructor Details

    • ItemComponent

      public ItemComponent(String itemName, ItemType itemType, int weight)
      Called when the item is created and initates necessary variables
      Parameters:
      itemName - - a string which is the name of the item
      itemType - - an ItemType which is the type of the item
      weight - - an intger which is the weight of the item
  • Method Details

    • getItemId

      public String getItemId()
      Gets the id of the item
      Returns:
      a string which is the randomly generated id of the item
    • getItemName

      public String getItemName()
      Gets the name of the item
      Returns:
      a string which is the name of the item
    • getWeight

      public int getWeight()
      Gets the weight of the item
      Returns:
      a string which is the weight of the item
    • getItemType

      public ItemType getItemType()
      Gets the type of the item
      Returns:
      an itemType which is the type the items is
    • getTexturePath

      public String getTexturePath()
      Returns the path to the texture for this ItemComponent.
      Returns:
      a String which is the path to the image of the parent entity's TextureRenderComponent. If this component does not have a parent entity, returns null