Class ItemComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.items.ItemComponent

public class ItemComponent extends Component
ItemComponent provides the ability to add an Item Type to an Entity for the purpose of identifying the particular Item an animation Entity is representing.

This Component tags an Entity as an Item and stores its Type.

  • Constructor Details

    • ItemComponent

      public ItemComponent(ItemComponent.Type type)
      Creates a new ItemComponent with the given Type.
      Parameters:
      type - the Item type (enumerators)
  • Method Details

    • getType

      public ItemComponent.Type getType()
      Returns the Item Type associated with the component.
      Returns:
      Type type of Item