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 GameEvent
clone()
getDescription
(GameContext context, int playerId) A user-renderable description of what occurred in this notification.abstract com.hiddenswitch.spellsource.rpc.Spellsource.GameEventTypeMessage.GameEventType
For visualization purposes, what is the source of this notification?int
int
getTargets
(GameContext context, int player) For visualization purposes, what are the targets of this notification?boolean
When 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, wait
Methods 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:Notification
For visualization purposes, what is the source of this notification?- Specified by:
getSource
in interfaceNotification
- Returns:
- A reference to the entity that is the visualizable source of this notification.
-
getTarget
-
getTargets
Description copied from interface:Notification
For visualization purposes, what are the targets of this notification?- Specified by:
getTargets
in 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:Notification
When true, indicates to processors of this notification that it belongs in the power history.- Specified by:
isPowerHistory
in interfaceNotification
- Returns:
true
if this notification should be stored in the power history of the game where it occurred.
-
getDescription
Description copied from interface:Notification
A user-renderable description of what occurred in this notification.- Specified by:
getDescription
in interfaceNotification
- Parameters:
context
- the game contextplayerId
- the player ID- Returns:
- a description string
-
clone
-