soc.game
Enum SOCGame.SeatLockState

java.lang.Object
  extended by java.lang.Enum<SOCGame.SeatLockState>
      extended by soc.game.SOCGame.SeatLockState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SOCGame.SeatLockState>
Enclosing class:
SOCGame

public static enum SOCGame.SeatLockState
extends java.lang.Enum<SOCGame.SeatLockState>

Seat lock states for lock/unlock. Note different meanings while game is forming (gameState NEW) versus already active.

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

Enum Constant Summary
CLEAR_ON_RESET
          If this active game is reset, a robot will not take this seat, it will be left vacant.
LOCKED
          Seat is locked.
UNLOCKED
          Seat not locked.
 
Method Summary
static SOCGame.SeatLockState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SOCGame.SeatLockState[] 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

UNLOCKED

public static final SOCGame.SeatLockState UNLOCKED
Seat not locked. If game is forming, if this seat is empty when the game starts, a bot can sit here. If game is active, a newly-joining player can take over a bot in this seat.


LOCKED

public static final SOCGame.SeatLockState LOCKED
Seat is locked. If game is forming, a bot will not sit here when the game starts. If game is active, a newly-joining player can't take over a bot in this seat.


CLEAR_ON_RESET

public static final SOCGame.SeatLockState CLEAR_ON_RESET
If this active game is reset, a robot will not take this seat, it will be left vacant. Useful for resetting a game to play again with fewer robots, if a robot is currently sitting here. Not a valid seat lock state if game is still forming.

This feature was added in v2.0.00; before that version, the seat lock state was boolean (UNLOCKED or LOCKED). Game resets included all robots unless their seat was LOCKED at the time of reset.

Method Detail

values

public static SOCGame.SeatLockState[] 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 (SOCGame.SeatLockState c : SOCGame.SeatLockState.values())
    System.out.println(c);

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

valueOf

public static SOCGame.SeatLockState valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null