Class FireExtinguisherHandlerComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.station.FireExtinguisherHandlerComponent
Give the player a fire extinguisher when they interact with it
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.void
givePutExtinguisher
(Entity player) Gives or puts back the fire extinguisher from the inventorystatic boolean
handleFireExtinguisher
(com.badlogic.gdx.physics.box2d.Fixture fixture, Entity player) Handles getting and putting back the fire extinguisher when the player interactsMethods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
FireExtinguisherHandlerComponent
public FireExtinguisherHandlerComponent()
-
-
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. -
handleFireExtinguisher
public static boolean handleFireExtinguisher(com.badlogic.gdx.physics.box2d.Fixture fixture, Entity player) Handles getting and putting back the fire extinguisher when the player interacts- Parameters:
fixture
- The fixture of the object that was interacted withplayer
- The player entity- Returns:
- Whether the fire extinguisher was handled
-
givePutExtinguisher
Gives or puts back the fire extinguisher from the inventory- Parameters:
player
- The player entity component
-