Package com.csse3200.game.components.npc
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
Component that enables animals to drop different items on different triggers.
Each item can be dropped at a different rate.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMultiDropComponent
(List<SingleDropHandler> singleDropHandlers, boolean handlesDeath) Constructor for MultiDropComponent -
Method Summary
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, read, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update, write
-
Constructor Details
-
MultiDropComponent
Constructor for MultiDropComponent- Parameters:
singleDropHandlers
- Handlers for each individual item being droppedhandlesDeath
- 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. -
dispose
public void dispose()Description copied from class:Component
Called when the component is disposed. Dispose of any internal resources here.
-