cz.cuni.amis.pogamut.ut2004.hideandseek.protocol
Enum HSGameState

Package class diagram package HSGameState
java.lang.Object
  extended by java.lang.Enum<HSGameState>
      extended by cz.cuni.amis.pogamut.ut2004.hideandseek.protocol.HSGameState
All Implemented Interfaces:
Serializable, Comparable<HSGameState>

public enum HSGameState
extends 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

NOT_RUNNING

public static final HSGameState NOT_RUNNING
Switches to GAME_STARTED once UT2004HSServer#startGame(int, int) is called.


GAME_STARTED

public static final HSGameState GAME_STARTED
Announces HSGameStart, switches to START_NEXT_ROUND.


START_NEXT_ROUND

public static final HSGameState START_NEXT_ROUND
Technical point, before 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.


ROUND_STARTING

public static final HSGameState 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. Switches to HIDING_TIME


HIDING_TIME

public static final HSGameState HIDING_TIME
When the round state switches into this state, the ROUND has been STARTED.

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.


SPAWNING_SEEKER

public static final HSGameState SPAWNING_SEEKER
Spawns 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".


RESTRICTED_AREA_ACTIVE

public static final HSGameState RESTRICTED_AREA_ACTIVE
Round is fully running at this point already, 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.


ROUND_RUNNING

public static final HSGameState ROUND_RUNNING
Round is fully running at this point, 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.


ROUND_ENDED

public static final HSGameState ROUND_ENDED
Configure all bots to manual spawn + kills all remaining bots (including HSBotState.SEEKER) in the game.

Switches back to START_NEXT_ROUND.

Field Detail

stateNumber

public final int stateNumber
Method Detail

values

public static HSGameState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HSGameState c : HSGameState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HSGameState valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getGameState

public static HSGameState getGameState(int stateNumber)


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.