Class GameEvent

java.lang.Object
net.demilich.metastone.game.events.GameEvent
All Implemented Interfaces:
Serializable, Cloneable, Notification
Direct Known Subclasses:
BasicGameEvent, JoustEvent

public abstract class GameEvent extends Object implements Notification, Cloneable
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.

See Also:
  • Constructor Details

  • Method Details

    • getSource

      public Entity getSource()
      Description copied from interface: Notification
      For visualization purposes, what is the source of this notification?
      Specified by:
      getSource in interface Notification
      Returns:
      A reference to the entity that is the visualizable source of this notification.
    • getTarget

      public Entity getTarget()
    • getTargets

      public List<Entity> getTargets(GameContext context, int player)
      Description copied from interface: Notification
      For visualization purposes, what are the targets of this notification?
      Specified by:
      getTargets in interface Notification
      Parameters:
      context - game context
      player - 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

      public GameContext getGameContext()
    • getTargetPlayerId

      public int getTargetPlayerId()
    • getSourcePlayerId

      public int getSourcePlayerId()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 interface Notification
      Returns:
      true if this notification should be stored in the power history of the game where it occurred.
    • getDescription

      public String getDescription(GameContext context, int playerId)
      Description copied from interface: Notification
      A user-renderable description of what occurred in this notification.
      Specified by:
      getDescription in interface Notification
      Parameters:
      context - the game context
      playerId - the player ID
      Returns:
      a description string
    • clone

      protected GameEvent clone()
      Overrides:
      clone in class Object