Class GameEvent
java.lang.Object
net.demilich.metastone.game.events.GameEvent
- All Implemented Interfaces:
Serializable,Cloneable,Notification
- Direct Known Subclasses:
BasicGameEvent,JoustEvent
The base class for game events, or things that happen during the execution of a
GameAction that other game rules may react to.
A null source will resolve to the EntityReference.TRIGGER_HOST
when evaluating queueing and firing conditions.
-
Constructor Summary
ConstructorsConstructorDescriptionGameEvent(@NotNull GameContext context, Entity source, Entity target, int sourcePlayerId, int targetPlayerId) GameEvent(@NotNull GameContext context, Player player, Entity source, Entity target) -
Method Summary
Modifier and TypeMethodDescriptionprotected GameEventclone()getDescription(GameContext context, int playerId) A user-renderable description of what occurred in this notification.abstract com.hiddenswitch.spellsource.rpc.Spellsource.GameEventTypeMessage.GameEventTypeFor visualization purposes, what is the source of this notification?intintgetTargets(GameContext context, int player) For visualization purposes, what are the targets of this notification?booleanWhen true, indicates to processors of this notification that it belongs in the power history.toString()Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.demilich.metastone.game.events.Notification
getSource, isClientInterested
-
Constructor Details
-
GameEvent
public GameEvent(@NotNull @NotNull GameContext context, Player player, Entity source, Entity target) -
GameEvent
public GameEvent(@NotNull @NotNull GameContext context, Entity source, Entity target, int sourcePlayerId, int targetPlayerId)
-
-
Method Details
-
getSource
Description copied from interface:NotificationFor visualization purposes, what is the source of this notification?- Specified by:
getSourcein interfaceNotification- Returns:
- A reference to the entity that is the visualizable source of this notification.
-
getTarget
-
getTargets
Description copied from interface:NotificationFor visualization purposes, what are the targets of this notification?- Specified by:
getTargetsin interfaceNotification- Parameters:
context- game contextplayer- the player- Returns:
- A reference to the entity that is the visualizable target of this notification.
-
getEventType
public abstract com.hiddenswitch.spellsource.rpc.Spellsource.GameEventTypeMessage.GameEventType getEventType() -
getGameContext
-
getTargetPlayerId
public int getTargetPlayerId() -
getSourcePlayerId
public int getSourcePlayerId() -
toString
-
isPowerHistory
public boolean isPowerHistory()Description copied from interface:NotificationWhen true, indicates to processors of this notification that it belongs in the power history.- Specified by:
isPowerHistoryin interfaceNotification- Returns:
trueif this notification should be stored in the power history of the game where it occurred.
-
getDescription
Description copied from interface:NotificationA user-renderable description of what occurred in this notification.- Specified by:
getDescriptionin interfaceNotification- Parameters:
context- the game contextplayerId- the player ID- Returns:
- a description string
-
clone
-