Interface IMessageRecipient

All Superinterfaces:
MailSender
All Known Implementing Classes:
Console, SimpleMessageRecipient, User

public interface IMessageRecipient extends MailSender
Represents an interface for message recipients.
  • Method Details

    • sendMessage

      void sendMessage(String message)
      Sends (prints) a message to this recipient.
      Parameters:
      message - message
    • sendTl

      void sendTl(String tlKey, Object... args)
      Sends a translated message to this recipient.
      Parameters:
      tlKey - key
      args - arguments
    • tlSender

      String tlSender(String tlKey, Object... args)
      Translates a message.
      Parameters:
      tlKey - key
      args - arguments
      Returns:
      translated message
    • sendMessage

      This method is called when this IMessageRecipient is sending a message to another IMessageRecipient.

      The IMessageRecipient.MessageResponse that is returned is used to determine what exactly should happen in the sendMessage(IMessageRecipient, String) implementation by the sender.

      Parameters:
      recipient - recipient to receive the message
      message - message to send
      Returns:
      the response of the message
    • onReceiveMessage

      IMessageRecipient.MessageResponse onReceiveMessage(IMessageRecipient sender, String message)
      This method is called when this recipient is receiving a message from another IMessageRecipient.

      The IMessageRecipient.MessageResponse that is returned is used to determine what exactly should happen in the sendMessage(IMessageRecipient, String) implementation by the sender.

      This method should only be called by sendMessage(IMessageRecipient, String).

      Parameters:
      sender - sender of the message
      message - message being received
      Returns:
      the response of the message
    • getName

      String getName()
      Returns the name of this recipient. This name is typically used internally to identify this recipient.
      Specified by:
      getName in interface MailSender
      Returns:
      name of this recipient
      See Also:
    • getDisplayName

      String getDisplayName()
      Returns the display name of this recipient. This name is typically used when formatting messages.
      Returns:
      display name of this recipient
    • isReachable

      boolean isReachable()
      Returns whether this recipient is reachable. A case where the recipient is not reachable is if they are offline.
      Returns:
      whether this recipient is reachable
    • getReplyRecipient

      IMessageRecipient getReplyRecipient()
      Returns the IMessageRecipient this recipient should send replies to.
      Returns:
      message recipient
    • setReplyRecipient

      void setReplyRecipient(IMessageRecipient recipient)
      Sets the IMessageRecipient this recipient should send replies to.
      Parameters:
      recipient - message recipient to set
    • isHiddenFrom

      boolean isHiddenFrom(Player player)