|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||

java.lang.Objectjava.lang.Enum<HSGameState>
cz.cuni.amis.pogamut.ut2004.hideandseek.protocol.HSGameState
public enum HSGameState
| Enum Constant Summary | |
|---|---|
GAME_STARTED
Announces HSGameStart, switches to START_NEXT_ROUND. |
|
HIDING_TIME
When the round state switches into this state, the ROUND has been STARTED. |
|
NOT_RUNNING
Switches to GAME_STARTED once UT2004HSServer#startGame(int, int) is called. |
|
RESTRICTED_AREA_ACTIVE
Round is fully running at this point already, HSBotState.SEEKER may start HSBotSpotteding HSBotState.RUNNERs and they can be
HSBotTaggedOut. |
|
ROUND_ENDED
Configure all bots to manual spawn + kills all remaining bots (including HSBotState.SEEKER) in the game. |
|
ROUND_RUNNING
Round is fully running at this point, HSBotState.SEEKER may start HSBotSpotteding HSBotState.RUNNERs and they can be
HSBotTaggedOut. |
|
ROUND_STARTING
Announce HSRoundStarting, configures all bots to manual spawn, kills all bots, assign SEEKER, announces SEEKER via HSAssignSeeker,
start up HSObserver for the seeker and spawns all HSBotState.RUNNERs around the safe spot. |
|
SPAWNING_SEEKER
Spawns HSBotState.SEEKER previously advertised, switches to RESTRICTED_AREA_ACTIVE. |
|
START_NEXT_ROUND
Technical point, before ROUND_STARTING that initialize round fields properly. |
|
| Field Summary | |
|---|---|
int |
stateNumber
|
| Method Summary | |
|---|---|
static HSGameState |
getGameState(int stateNumber)
|
static HSGameState |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static HSGameState[] |
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 HSGameState NOT_RUNNING
GAME_STARTED once UT2004HSServer#startGame(int, int) is called.
public static final HSGameState GAME_STARTED
HSGameStart, switches to START_NEXT_ROUND.
public static final HSGameState START_NEXT_ROUND
ROUND_STARTING that initialize round fields properly. Switches to ROUND_STARTING almost immediately if there is any round left.
If all rounds have been finished, ends the game (which will ultimately result in switching into NOT_RUNNING state again.
public static final HSGameState ROUND_STARTING
HSRoundStarting, configures all bots to manual spawn, kills all bots, assign SEEKER, announces SEEKER via HSAssignSeeker,
start up HSObserver for the seeker and spawns all HSBotState.RUNNERs around the safe spot. Switches to HIDING_TIME
public static final HSGameState HIDING_TIME
At this point, all RUNNERs are spawned, but the SEEKER is not present in the environment yet.
At this point ALL RUNNERS must get out of restricted area that is present around the safe point (preferably hide itself somewhere) to
prevent being HSRunnerFouled. Note that it is prohibited to linger around safe-area for a certain amount of period after the round hiding time
passes by, see HSGameConfig.getRestrictedAreaTimeUT().
Once time hiding-time passes by, switches to SPAWNING_SEEKER.
public static final HSGameState SPAWNING_SEEKER
HSBotState.SEEKER previously advertised, switches to RESTRICTED_AREA_ACTIVE.
Note that we do not provide "restricted area time left" information in this state, but bots should treat this state as if "restricted area was activated".
public static final HSGameState RESTRICTED_AREA_ACTIVE
HSBotState.SEEKER may start HSBotSpotteding HSBotState.RUNNERs and they can be
HSBotTaggedOut.
Any HSBotState.RUNNER that gets into the restricted-are will be HSBotFauled (killed + penalized).
That means that no HSBotState.RUNNER can reach safe area.
Once restricted-area-active-time passes by, switches to ROUND_RUNNING.
If it happens that all HSBotState.RUNNERs are tagged or fouled, server switches to ROUND_ENDED.
public static final HSGameState ROUND_RUNNING
HSBotState.SEEKER may start HSBotSpotteding HSBotState.RUNNERs and they can be
HSBotTaggedOut.
Whenever HSBotState.RUNNER gets into the safe-area, it is HSBotSafed (killed + scores points).
Whenever all HSBotState.RUNNERs are tagged, fouled or safe, or round-time-passes server switches to ROUND_ENDED.
public static final HSGameState ROUND_ENDED
HSBotState.SEEKER) in the game.
Switches back to START_NEXT_ROUND.
| Field Detail |
|---|
public final int stateNumber
| Method Detail |
|---|
public static HSGameState[] values()
for (HSGameState c : HSGameState.values()) System.out.println(c);
public static HSGameState valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic static HSGameState getGameState(int stateNumber)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||