Class LockingMethod

java.lang.Object
group24.escaperoom.entities.properties.LockingMethod
All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable, ItemPropertyValue
Direct Known Subclasses:
CombinationLock, KeyLock, PassphraseLock, PowerLock, TrivialLock

public abstract class LockingMethod extends Object implements com.badlogic.gdx.utils.Json.Serializable, ItemPropertyValue
  • Field Details

    • isBarrier

      protected boolean isBarrier
    • owner

      protected Optional<Item> owner
    • isLocked

      protected boolean isLocked
  • Constructor Details

    • LockingMethod

      public LockingMethod()
  • Method Details

    • getName

      public abstract String getName()
    • isLocked

      public boolean isLocked()
    • getActions

      public abstract com.badlogic.gdx.utils.Array<PlayerAction> getActions()
    • getUnlockAction

      @Null public PlayerAction getUnlockAction(GameContext ctx)
      Get a player action that would unlock this locking method This can be null if the action is not valid, or if there is no such action for this lock
    • getLockAction

      @Null public PlayerAction getLockAction(GameContext ctx)
      Get a player action that would lock this locking method This can be null if the action is not valid, or if there is no such action for this lock
    • maybeGetLockAction

      @Null protected abstract PlayerAction maybeGetLockAction()
    • maybeGetUnlockAction

      @Null protected abstract PlayerAction maybeGetUnlockAction()
    • getType

      public abstract LockingMethodType getType()
    • onAttach

      public void onAttach(Item item)
    • onDetatch

      public void onDetatch()
    • getDisplay

      public Menu.MenuEntry getDisplay(Menu parent)
      Specified by:
      getDisplay in interface ItemPropertyValue
      Parameters:
      parent - the menu spawning this entry
      Returns:
      the Menu.MenuEntry describing this ItemPropertyValue
    • write

      public void write(com.badlogic.gdx.utils.Json json)
      Specified by:
      write in interface com.badlogic.gdx.utils.Json.Serializable
    • read

      public void read(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData)
      Specified by:
      read in interface com.badlogic.gdx.utils.Json.Serializable
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getEmptyMethod

      protected abstract LockingMethod getEmptyMethod()
    • clone

      protected LockingMethod clone(Item newOwner)