public class GameState extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
GameState.Field |
class |
GameState.VisibleField |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canEqual(Object other) |
static GameState |
createInitialGameState(GameStartApiResponse startData,
GameUpdateApiResponse firstUpdateData)
Creates the first game state just after the game is started.
|
boolean |
equals(Object o) |
String |
getChatRoom()
Identifier of the main game chat room.
|
int |
getColumns()
Horizontal size of the map.
|
Collection<GameState.Field> |
getFields() |
com.google.common.collect.ImmutableMap<Position,GameState.Field> |
getFieldsMap() |
Player |
getMyPlayer()
Representation of bot's player.
|
int |
getMyPlayerIndex()
Index of bot's player.
|
Collection<Integer> |
getMyTeamIndexes()
Indexes of players being in the same team as bot.
|
com.google.common.collect.ImmutableList<Player> |
getPlayers()
Players currently playing and those already dead.
|
String |
getReplayId()
Replay identifier.
|
int |
getRows()
Vertical size of the map.
|
String |
getTeamChatRoom()
Identifier of the private team chat room.
|
int |
getTurn()
"Server turn" which is increased after every update (possibility of making a move).
|
GameState.Field[][] |
getTwoDimensionalArrayOfFields() |
Collection<GameState.VisibleField> |
getVisibleFields() |
com.google.common.collect.ImmutableMap<Position,GameState.VisibleField> |
getVisibleFieldsMap() |
int |
hashCode() |
boolean |
isValidPosition(Position position)
Checks if given position lays inside the map.
|
Position |
positionFromIndex(int index) |
int |
positionToIndex(Position position) |
String |
toString() |
GameState |
update(GameUpdateApiResponse gameUpdateData)
Updates game state from previous turn with new information received from server.
|
public static GameState createInitialGameState(GameStartApiResponse startData, GameUpdateApiResponse firstUpdateData)
GameStartApiResponse and GameUpdateApiResponse. Cannot be use for further updates, as later game updates
from server contain only differences.public GameState update(GameUpdateApiResponse gameUpdateData)
public int getColumns()
public int getRows()
public int getTurn()
public com.google.common.collect.ImmutableList<Player> getPlayers()
public int getMyPlayerIndex()
public Player getMyPlayer()
getPlayers()public String getReplayId()
public String getChatRoom()
public String getTeamChatRoom()
public com.google.common.collect.ImmutableMap<Position,GameState.VisibleField> getVisibleFieldsMap()
public com.google.common.collect.ImmutableMap<Position,GameState.Field> getFieldsMap()
public Collection<GameState.Field> getFields()
public Collection<GameState.VisibleField> getVisibleFields()
public GameState.Field[][] getTwoDimensionalArrayOfFields()
public Position positionFromIndex(int index)
public int positionToIndex(Position position)
public boolean isValidPosition(Position position)
public Collection<Integer> getMyTeamIndexes()
protected boolean canEqual(Object other)
Copyright © 2017. All rights reserved.