Modifier and Type | Class and Description |
---|---|
class |
MancalaState.PlayerTurnStateProperty
Class containing whether the current slot/depot is enabled for the current player turn state.
|
class |
MancalaState.StoneNumProperty
Class containing the number of stones for a depot/slot.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Integer,MancalaState.PlayerTurnStateProperty> |
playerStates |
protected java.util.Map<java.lang.String,MancalaState.PlayerTurnStateProperty> |
states |
protected java.util.Map<java.lang.String,MancalaState.StoneNumProperty> |
stones |
Modifier | Constructor and Description |
---|---|
protected |
MancalaState()
Constructor for custom states, useful for testing
|
protected |
MancalaState(MancalaBoard board)
Creates the default MancalaState for the board, where each slot has "stones per slot" many
stones.
|
Modifier and Type | Method and Description |
---|---|
State |
copy() |
int |
getCurrentPlayer() |
javafx.beans.property.IntegerProperty |
getStoneProperty(java.lang.String id)
Stone number property.
|
javafx.beans.binding.BooleanExpression |
isSlotEnabledProperty(java.lang.String id)
Slot enabled property.
|
void |
setCurrentPlayer(int currentPlayer) |
int |
stonesIn(java.lang.String id)
returns how many stones are in the given slot/depot.
|
protected java.util.Map<java.lang.String,MancalaState.StoneNumProperty> stones
protected java.util.Map<java.lang.String,MancalaState.PlayerTurnStateProperty> states
protected java.util.Map<java.lang.Integer,MancalaState.PlayerTurnStateProperty> playerStates
protected MancalaState()
protected MancalaState(MancalaBoard board)
board
- The board for which the state should be createdpublic int stonesIn(java.lang.String id)
id
- The id of the slot/depotpublic javafx.beans.property.IntegerProperty getStoneProperty(java.lang.String id)
id
- For what slot/depot?public javafx.beans.binding.BooleanExpression isSlotEnabledProperty(java.lang.String id)
id
- For what slot?public void setCurrentPlayer(int currentPlayer)
setCurrentPlayer
in interface State
public int getCurrentPlayer()
getCurrentPlayer
in interface State