soc.game
Interface SOCScenarioEventListener

All Known Implementing Classes:
SOCGameHandler, SOCPlayerInterface

public interface SOCScenarioEventListener

Listener for scenario events on the large sea board.

Threads: These events occur in game methods (or player methods) that change game state. So, whatever thread changed the game state, that same thread will run the listener callback method.

Since:
2.0.00
Author:
Jeremy D Monin <jeremy@nand.net>

Method Summary
 void gameEvent(SOCGame ga, SOCScenarioGameEvent evt, java.lang.Object detail)
          A scenario event has occurred whichs affect the game or board, not a specific player.
 void playerEvent(SOCGame ga, SOCPlayer pl, SOCScenarioPlayerEvent evt, boolean flagsChanged, java.lang.Object obj)
          A per-player scenario event has occurred.
 

Method Detail

gameEvent

void gameEvent(SOCGame ga,
               SOCScenarioGameEvent evt,
               java.lang.Object detail)
A scenario event has occurred whichs affect the game or board, not a specific player.

Threads: The game's treater thread handles incoming client messages and calls game methods that change state. Those same game methods will trigger the scenario events; so, the treater thread will also run this gameEvent callback.

Parameters:
ga - Game
evt - Event code
detail - Game piece, coordinate, or other data about the event, or null, depending on evt

playerEvent

void playerEvent(SOCGame ga,
                 SOCPlayer pl,
                 SOCScenarioPlayerEvent evt,
                 boolean flagsChanged,
                 java.lang.Object obj)
A per-player scenario event has occurred.

Parameters:
ga - Game
pl - Player
evt - Event code
flagsChanged - True if this event changed SOCPlayer.getScenarioPlayerEvents(), SOCPlayer.getSpecialVP(), or another flag documented for evt in SOCScenarioPlayerEvent
obj - Object related to the event, or null; documented for evt in SOCScenarioPlayerEvent. Example: The SOCVillage for SOCScenarioPlayerEvent.CLOTH_TRADE_ESTABLISHED_VILLAGE.