Class MultiDropComponent

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

public class MultiDropComponent extends Component
Component that enables animals to drop different items on different triggers. Each item can be dropped at a different rate.
  • Constructor Details

    • MultiDropComponent

      public MultiDropComponent(List<SingleDropHandler> singleDropHandlers, boolean handlesDeath)
      Constructor for MultiDropComponent
      Parameters:
      singleDropHandlers - Handlers for each individual item being dropped
      handlesDeath - True iff this singleDropHandlers contains a 'death' trigger
  • Method Details

    • getHandlesDeath

      public boolean getHandlesDeath()
      Returns whether this component handles death
      Returns:
      True iff the component handles death, false otherwise.
    • 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
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Overrides:
      dispose in class Component