Class DoorComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.DoorComponent

public class DoorComponent extends Component
A simple door trigger that runs a callback when the player collides with it. Keycard requirements are handled separately by KeycardGateComponent.
  • Constructor Details

    • DoorComponent

      public DoorComponent(Runnable onEntered)
  • 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
    • setOverrideUnlocked

      public void setOverrideUnlocked(boolean enabled)
      Enable/disable the unlock override for this door. When enabled, other systems (e.g., KeycardGateComponent) should allow this door to open.
    • isOverrideUnlocked

      public boolean isOverrideUnlocked()
      Returns:
      true if the unlock override is enabled for this door.