Package megamek.common.event
Class GameToastEvent
java.lang.Object
java.util.EventObject
megamek.common.event.GameEvent
megamek.common.event.GameToastEvent
- All Implemented Interfaces:
Serializable
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumLayer-neutral severity for a toast, mirrored by the client UI's own toast styling. -
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionGameToastEvent(Object source, GameToastEvent.Level level, String message, int entityId) -
Method Summary
Methods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
GameToastEvent
- Parameters:
source- the event source (usually the client)level- the severity of the toastmessage- the (already localized) text to displayentityId- the id of the acting unit whose icon should accompany the toast, orBTObject.NONEfor a text-only toast
-
-
Method Details
-
level
-
message
-
entityId
public int entityId() -
fireEvent
Description copied from class:GameEventSub-classed events implement this method to call their specific method on a GameListener instance that their event has been fired. -
getEventName
- Specified by:
getEventNamein classGameEvent
-