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

public class HousePortal extends AccessCheckingPortal
A portal that can be used with a matching HouseKey. The requirements are saved with the portal.
  • Constructor Details

    • HousePortal

      public HousePortal(String doorId)
      Create a HousePortal.
      Parameters:
      doorId - the door identifier
    • HousePortal

      public HousePortal(RPObject object)
      Create a HousePortal from an RPObject. Used when restoring from the database.
      Parameters:
      object - the corresponding RPObject
  • Method Details

    • generateRPClass

      public static void generateRPClass()
    • setOwner

      public void setOwner(String owner)
      Sets the owner of this portal.
      Parameters:
      owner - name of the owner.
    • setDestination

      public void setDestination(String zone, Object id)
      Description copied from class: Portal
      Set the destination portal zone and reference. The reference should match the same type/value as that passed to setReference() in the corresponding portal.
      Overrides:
      setDestination in class Portal
      Parameters:
      zone - The target zone.
      id - A reference tag.
    • setIdentifier

      public void setIdentifier(Object id)
      Description copied from class: Portal
      Set the portal reference to identify this specific portal with-in a zone. This value is opaque and requires a working equals(), but typically uses a String or Integer.
      Overrides:
      setIdentifier in class Portal
      Parameters:
      id - A reference tag.
    • describe

      public String describe()
      Description copied from class: Entity
      Describes the entity (if a players looks at it).
      Overrides:
      describe in class Entity
      Returns:
      description from the players point of view
    • isAllowed

      protected boolean isAllowed(RPEntity user)
      Description copied from class: AccessCheckingPortal
      Determine if this portal can be used.
      Specified by:
      isAllowed in class AccessCheckingPortal
      Parameters:
      user - The user to be checked.
      Returns:
      true if the user can use the portal.
    • getDoorId

      public String getDoorId()
      Get the identification string of this portal.
      Returns:
      the identification string
    • getPortalNumber

      public int getPortalNumber()
      Get the house number of this portal.
      Returns:
      the house number, or 0 if house number not found
    • getOwner

      public String getOwner()
      Get the name of the owner.
      Returns:
      owner
    • getLockNumber

      public int getLockNumber()
      Get the number of the lock.
      Returns:
      number of the lock
    • changeLock

      public void changeLock()
      Increase the lock number by one.
    • getExpireTime

      public long getExpireTime()
      Get the expiration time of the portal.
      Returns:
      time in milliseconds
    • setExpireTime

      public void setExpireTime(long time)
      Set the expiration time of the portal.
      Parameters:
      time - time in milliseconds
    • setAssociatedZones

      public void setAssociatedZones(String zones)
      Sets other zones that should hear knocking on door.
      Parameters:
      zones - Comma-separated string of zone names.
    • getAssociatedZones

      public String getAssociatedZones()
      Gets other zones that should hear knocking on door.
    • getAssociatedZonesList

      public List<String> getAssociatedZonesList()
      Gets other zones that should hear knocking on door.