public class NFGameState extends java.lang.Object implements MutableState, StateGenerator
Modifier and Type | Field and Description |
---|---|
java.lang.String[] |
players |
Constructor and Description |
---|
NFGameState()
Default constructor for serialization
|
NFGameState(int numPlayers) |
NFGameState(java.lang.String[] players) |
Modifier and Type | Method and Description |
---|---|
State |
copy()
Returns a copy of this state suitable for creating state transitions.
|
State |
generateState()
Returns a new state object.
|
protected int |
genInd(java.lang.Object variableKey) |
java.lang.Object |
get(java.lang.Object variableKey)
Returns the value for the given variable key.
|
int |
playerIndex(java.lang.String playerName) |
MutableState |
set(java.lang.Object variableKey,
java.lang.Object value)
Sets the value for the given variable key.
|
java.lang.String |
toString() |
java.util.List<java.lang.Object> |
variableKeys()
Returns the list of state variable keys.
|
public NFGameState()
public NFGameState(int numPlayers)
public NFGameState(java.lang.String[] players)
public State generateState()
StateGenerator
generateState
in interface StateGenerator
public MutableState set(java.lang.Object variableKey, java.lang.Object value)
MutableState
set
in interface MutableState
variableKey
- the key identifier for the variable value to changevalue
- the variable value to which the variable should be set.public java.util.List<java.lang.Object> variableKeys()
State
variableKeys
in interface State
public java.lang.Object get(java.lang.Object variableKey)
State
public State copy()
State
DeepCopyState
or ShallowCopyState
annotations. If it is a shallow copy, you should not *directly*
modify any fields of a copied state without copying the fields first, or it could contaminate the state from
which the copy was made. Alternatively, use the MutableState.set(Object, Object)
method to modify
ShallowCopyState
copied states,
which for ShallowCopyState
instances should perform a safe copy-on-write operation.public java.lang.String toString()
toString
in class java.lang.Object
public int playerIndex(java.lang.String playerName)
protected int genInd(java.lang.Object variableKey)