Package rea.events

Class MessageUpdateEvent

java.lang.Object
rea.events.MessageUpdateEvent
All Implemented Interfaces:
UpdateEvent

public class MessageUpdateEvent extends Object implements UpdateEvent
An event that delivers a message to a player. The message can be delivered by a character or by the game itself. In the later case, the speaker is null.
Author:
José Paulo Leal jpleal@fc.up.pt
  • Constructor Details

    • MessageUpdateEvent

      public MessageUpdateEvent(String message)
      Create a message update event with a message.
      Parameters:
      message - to deliver
    • MessageUpdateEvent

      public MessageUpdateEvent(Character speaker, String message)
      Create a message update event with a message and a speaker.
      Parameters:
      speaker - the character delivering the message
      message - to deliver
  • Method Details

    • getMessage

      public String getMessage()
      The message to deliver
      Returns:
      the message
    • getSpeaker

      public Character getSpeaker()
      The character that uttered the message. If the message was generated by the game itself, the speaker is null.
      Returns:
      the speaker