Class GateKey

All Implemented Interfaces:
EquipListener, TurnListener, UseListener, Killer, Cloneable, Iterable<String>, Serializable

public class GateKey extends Item
A key that matches if the gate identifier is right.
  • Constructor Details

    • GateKey

      public GateKey(String name, String clazz, String subclass, Map<String,​String> attributes)
    • GateKey

      public GateKey(GateKey key)
      Copy constructor.
      Parameters:
      key - the key to be copied.
  • Method Details

    • setup

      public void setup(String gateId, long expirationTime)
      Sets the key to open the set lock identifier and to expire at the given time.
      Parameters:
      gateId - The identifier to link with.
      expirationTime - time stamp
    • matches

      public boolean matches(String gateId)
      Checks if the key matches the given gate identifier.
      Parameters:
      gateId - Identifier of the gate
      Returns:
      true if the identifiers match, false otherwise