Class FireExtinguisherHandlerComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.station.FireExtinguisherHandlerComponent

public class FireExtinguisherHandlerComponent extends Component
Give the player a fire extinguisher when they interact with it
  • 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.
      Overrides:
      create in class Component
    • 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 with
      player - The player entity
      Returns:
      Whether the fire extinguisher was handled
    • givePutExtinguisher

      public void givePutExtinguisher(Entity player)
      Gives or puts back the fire extinguisher from the inventory
      Parameters:
      player - The player entity component