Class KeycardGateComponent

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

public class KeycardGateComponent extends Component
A gate that requires a specific keycard level to pass through. The gate will remain locked until the player collides with it AND has the required keycard level in their InventoryComponent.
  • Constructor Details

    • KeycardGateComponent

      public KeycardGateComponent(int requiredLevel, Runnable onUnlock)
  • Method Details

    • setGlobalOverride

      public static void setGlobalOverride(boolean enabled)
      Enable/disable the global keycard-gate override.
    • isGlobalOverride

      public static boolean isGlobalOverride()
      Returns:
      true if the global override is enabled.
    • 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
    • unlock

      public void unlock()
    • isUnlocked

      public boolean isUnlocked()