Class ItemActions

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.items.ItemActions
All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable

public class ItemActions extends Component
  • Constructor Details

    • ItemActions

      public ItemActions()
  • 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.
      Overrides:
      create in class Component
    • use

      public boolean use(Entity player, com.badlogic.gdx.math.Vector2 mousePos)
      Uses the item at the given position
      Parameters:
      player - the player entity using the item
      mousePos - the position of the mouse
      Returns:
      if interaction with tile was success return true else return false.
    • eat

      public void eat(Entity player)
      Eats a given food item or power modifier
      Parameters:
      player - the player entity