public class VisibleField extends Field
gameStateContext| Constructor and Description |
|---|
VisibleField(GameStateFieldContext gameStateContext,
Position position,
FieldTerrainType terrainType,
Optional<Integer> ownerIndex,
int army,
boolean city,
boolean general) |
| Modifier and Type | Method and Description |
|---|---|
VisibleField |
asVisibleField()
Converts to a VisibleField instance that exposes more details about the field.
|
int |
getArmy() |
Optional<Integer> |
getOwnerIndex()
Index of player that owns the field.
|
boolean |
hasOwner() |
boolean |
isBlank()
Returns true if field is represented with a white square in the brower (not mountain, not city, no owner).
|
boolean |
isCity() |
boolean |
isGeneral() |
boolean |
isObstacle()
If the field is not visible, true indicates city or mountain, if the field is visible true indicates only mountain.
|
boolean |
isOwnedBy(int playerIndex) |
boolean |
isOwnedByEnemy()
Returns true if field has an owner but owner is not in the same team as bot.
|
boolean |
isOwnedByMe() |
boolean |
isOwnedByMyTeam() |
boolean |
isVisible()
Determines whether in the current round the field is visible or in the fog of war.
|
String |
toString() |
getIndex, getNeighbours, getPosition, getTerrainType, getVisibleNeighbourspublic VisibleField(GameStateFieldContext gameStateContext, Position position, FieldTerrainType terrainType, Optional<Integer> ownerIndex, int army, boolean city, boolean general)
public boolean isVisible()
FieldField.asVisibleField() method can be used to obtain additional info about this field.public boolean isObstacle()
FieldisObstacle in class Fieldpublic VisibleField asVisibleField()
FieldField.isVisible().asVisibleField in class Fieldpublic boolean isOwnedBy(int playerIndex)
public boolean isOwnedByMe()
public boolean isOwnedByMyTeam()
public boolean isOwnedByEnemy()
public boolean isBlank()
public boolean hasOwner()
public int getArmy()
public boolean isGeneral()
public boolean isCity()
Copyright © 2017. All rights reserved.