Class PasswordPortal

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

public class PasswordPortal extends Portal
a portal which requires a password to pass through
  • Constructor Details

    • PasswordPortal

      public PasswordPortal()
      Creates a default PasswordPortal
    • PasswordPortal

      public PasswordPortal(String password)
      creates a portal which requires a password to be said by the player
      Parameters:
      password - password to say
  • Method Details

    • getPassword

      public String getPassword()
      gets the password
      Returns:
      password
    • getRejectedMessage

      public String getRejectedMessage()
      gets the reject message
      Returns:
      reject message
    • logic

      public void logic()
      Overrides:
      logic in class Portal
    • onUsed

      public boolean onUsed(RPEntity user)
      Override so portal does not get "used"
      Specified by:
      onUsed in interface UseListener
      Overrides:
      onUsed in class Portal
      Parameters:
      user - the RPEntity who uses the object
      Returns:
      true if successful
    • setAcceptedMessage

      public void setAcceptedMessage(String message)
      Optional message to be sent to player when portal is successfully used
      Parameters:
      message - Message to be sent
    • setListeningRadius

      public void setListeningRadius(int radius)
      Parameters:
      radius - Radius at which portal will listen for player's speech
    • setPassword

      public void setPassword(String password)
      sets the required password
      Parameters:
      password - new password
    • setRejectedMessage

      public void setRejectedMessage(String message)
      sets the reject message
      Parameters:
      message - message informing the player about the failed condition