|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<SOCScenarioGameEvent> soc.game.SOCScenarioGameEvent
public enum SOCScenarioGameEvent
Scenario event codes which affect the game or board, not only a specific player.
Used by SOCScenarioEventListener
s.
Each event also has a SOCGameOption
to indicate its scenario rules are active; see enum value javadocs.
Not all scenario-related rules changes have or need an event, only those that sometimes
fire and sometimes don't when a player takes an action. See SOCScenarioPlayerEvent
for more
details.
Game Event example: Not every hex is a fog hex (SGE_FOG_HEX_REVEALED
), so fog isn't
revealed every time a player builds a settlement or road. If this happened each time, the scenario-related
code might be clearer if it was located at the game/server logic for placing pieces, instead of code
elsewhere in an event listener.
SOCScenarioPlayerEvent
Enum Constant Summary | |
---|---|
SGE_CLVI_WIN_VILLAGE_CLOTH_EMPTY
Special win condition for this scenario: A player has won because less than half the villages have cloth remaining. |
|
SGE_FOG_HEX_REVEALED
A hex hidden by fog has been revealed by road or ship placement. |
|
SGE_PIRI_LAST_FORTRESS_FLEET_DEFEATED
The last pirate fortress was recaptured by the current player, and the pirate fleet defeated and removed from the board. |
|
SGE_STARTPLAY_BOARD_SPECIAL_NODES_EMPTIED
Normal game play is starting at the end of initial placement, and one or more sets of special nodes (Added Layout Parts "N1" - "N9") was emptied out. |
Field Summary | |
---|---|
int |
flagValue
Value for sending event codes over a network. |
Method Summary | |
---|---|
static SOCScenarioGameEvent |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static SOCScenarioGameEvent[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final SOCScenarioGameEvent SGE_STARTPLAY_BOARD_SPECIAL_NODES_EMPTIED
Fired locally at server or client from SOCGame.updateAtGameFirstTurn()
,
not sent over the network. In
SOCScenarioEventListener.gameEvent(SOCGame, SOCScenarioGameEvent, Object)
,
the detail
parameter is unused.
public static final SOCScenarioGameEvent SGE_FOG_HEX_REVEALED
_SC_FOG
.
Revealing a normal land hex (clay, ore, sheep, wheat, wood)
gives the player 1 of that resource immediately.
This event fires only at the server. During initial placement, placing a settlement at a node next to fog could reveal up to 3 hexes. This event fires once for each hex revealed.
In SOCScenarioEventListener.gameEvent(SOCGame, SOCScenarioGameEvent, Object)
,
detail is the revealed hex's coordinate as an Integer.
public static final SOCScenarioGameEvent SGE_CLVI_WIN_VILLAGE_CLOTH_EMPTY
SOCGame.vp_winner
.
In SOCScenarioEventListener.gameEvent(SOCGame, SOCScenarioGameEvent, Object)
,
detail is the winning SOCPlayer
.
Checked in private method SOCGame.checkForWinner_SC_CLVI()
public static final SOCScenarioGameEvent SGE_PIRI_LAST_FORTRESS_FLEET_DEFEATED
Field Detail |
---|
public final int flagValue
flagValue
.
Method Detail |
---|
public static SOCScenarioGameEvent[] values()
for (SOCScenarioGameEvent c : SOCScenarioGameEvent.values()) System.out.println(c);
public static SOCScenarioGameEvent valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |