Class GameToastEvent

All Implemented Interfaces:
Serializable

public class GameToastEvent extends GameEvent
A game event raised when the server wants the client to show a transient toast notification on the board view - for example, "Fortification complete" when Trench/Fieldworks Engineers finish a fortified hex.

The severity is expressed with the layer-neutral GameToastEvent.Level enum so that this common event carries no dependency on the client UI's toast rendering type; the client maps GameToastEvent.Level to its own toast styling when it shows the message.

See Also:
  • Constructor Details

    • GameToastEvent

      public GameToastEvent(Object source, GameToastEvent.Level level, String message, int entityId)
      Parameters:
      source - the event source (usually the client)
      level - the severity of the toast
      message - the (already localized) text to display
      entityId - the id of the acting unit whose icon should accompany the toast, or BTObject.NONE for a text-only toast
  • Method Details

    • level

      public GameToastEvent.Level level()
    • message

      public String message()
    • entityId

      public int entityId()
    • fireEvent

      public void fireEvent(GameListener gl)
      Description copied from class: GameEvent
      Sub-classed events implement this method to call their specific method on a GameListener instance that their event has been fired.
      Specified by:
      fireEvent in class GameEvent
      Parameters:
      gl - GameListener recipient.
    • getEventName

      public String getEventName()
      Specified by:
      getEventName in class GameEvent