public class UpdatableGameState extends Object implements GameState
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canEqual(Object other) |
static UpdatableGameState |
createInitialGameState(GameStartApiResponse startData,
GameUpdateApiResponse firstUpdateData)
Creates the first game state just after the game is started.
|
boolean |
equals(Object o) |
int |
getAttackIndex()
Officially "the attackIndex field is unnecessary for bots -- it's used by our client to show/hide attack arrows when appropriate."
|
int |
getColumns()
Horizontal size of the map.
|
com.google.common.collect.ImmutableMap<Position,Field> |
getFieldsMap() |
GameStarted |
getGameStartedData() |
com.google.common.collect.ImmutableList<Player> |
getPlayers()
Players currently playing and those already dead.
|
int |
getRows()
Vertical size of the map.
|
int |
getTurn()
"Server turn" which is increased after every update (possibility of making a move).
|
com.google.common.collect.ImmutableMap<Position,VisibleField> |
getVisibleFieldsMap() |
int |
hashCode() |
String |
toString() |
UpdatableGameState |
update(GameUpdateApiResponse gameUpdateData)
Updates game state from previous turn with new information received from server.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChatRoom, getFields, getMyPlayer, getMyPlayerIndex, getMyTeamIndexes, getNeighbourPositions, getNeighbours, getReplayId, getTeamChatRoom, getTwoDimensionalArrayOfFields, getVisibleFields, isValidPosition, positionFromIndex, positionToIndexpublic static UpdatableGameState createInitialGameState(GameStartApiResponse startData, GameUpdateApiResponse firstUpdateData)
GameStartApiResponse and GameUpdateApiResponse. Cannot be use for further updates, as later game updates
from server contain only differences.public UpdatableGameState update(GameUpdateApiResponse gameUpdateData)
public int getColumns()
GameStategetColumns in interface GameStatepublic int getRows()
GameStatepublic int getTurn()
GameStatepublic int getAttackIndex()
GameStategetAttackIndex in interface GameStatepublic com.google.common.collect.ImmutableMap<Position,Field> getFieldsMap()
getFieldsMap in interface GameStatepublic com.google.common.collect.ImmutableMap<Position,VisibleField> getVisibleFieldsMap()
getVisibleFieldsMap in interface GameStatepublic com.google.common.collect.ImmutableList<Player> getPlayers()
GameStategetPlayers in interface GameStatepublic GameStarted getGameStartedData()
getGameStartedData in interface GameStateprotected boolean canEqual(Object other)
Copyright © 2017. All rights reserved.