GameState

Methods
9
Fields
9

Getting one

GameState.valueOf(…)
GameState.of(…)
GameState.UNKNOWN

Methods

MethodReturnsDescription
name()stringThe constant's name as declared.
ordinal()numberThe constant's 0-based position in values().
toString()stringname(); tostring(c) answers the same.
compareTo(GameState)numberThis ordinal less other's.
equals(any)booleanWhether other is this constant. == answers the same.
getState()numberThis constant's getState() value, listed on each constant.
values(){GameState}Every constant in ordinal order, as a 1-based array: the same frozen array every values() call, so table.clone it before changing it.
valueOf(string)GameStatevalueOf(name): the constant named name; any other name is an error.
of(number)GameStateThe constant whose getState() is state, or UNKNOWN.

Fields

FieldTypeDescription
UNKNOWNGameStateUNKNOWN: ordinal 0; getState() -1.
STARTINGGameStateSTARTING: ordinal 1; getState() 0.
LOGIN_SCREENGameStateLOGIN_SCREEN: ordinal 2; getState() 10.
LOGIN_SCREEN_AUTHENTICATORGameStateLOGIN_SCREEN_AUTHENTICATOR: ordinal 3; getState() 11.
LOGGING_INGameStateLOGGING_IN: ordinal 4; getState() 20.
LOADINGGameStateLOADING: ordinal 5; getState() 25.
LOGGED_INGameStateLOGGED_IN: ordinal 6; getState() 30.
CONNECTION_LOSTGameStateCONNECTION_LOST: ordinal 7; getState() 40.
HOPPINGGameStateHOPPING: ordinal 8; getState() 45.

Returned by

MethodReturnsDescription
Client.getGameStateGameStateThe game state (GameState.of of the client's value; UNKNOWN for one with no constant).
GameStateChanged.getGameStateGameStateThe new state.
GameStateClass.ofGameStateThe constant whose getState() is state, or UNKNOWN.
GameStateClass.valueOfGameStatevalueOf(name): the constant named name; any other name is an error.
GameStateClass.values{GameState}Every constant in ordinal order, as a 1-based array: the same frozen array every values() call, so table.clone it before changing it.

Method details

ordinal

ordinal: (GameState) -> number

The constant's 0-based position in values().

equals

equals: (GameState, any) -> boolean

Whether other is this constant. == answers the same.

getState

getState: (GameState) -> number

This constant's getState() value, listed on each constant.

values

values: () -> {GameState}

Every constant in ordinal order, as a 1-based array: the same frozen array every values() call, so table.clone it before changing it.

valueOf

valueOf: (string) -> GameState

valueOf(name): the constant named name; any other name is an error.

of

of: (number) -> GameState

The constant whose getState() is state, or UNKNOWN.