public class Field extends Object
| Modifier and Type | Field and Description |
|---|---|
protected GameStateFieldContext |
gameStateContext |
| Constructor and Description |
|---|
Field(GameStateFieldContext gameStateContext,
Position position,
FieldTerrainType terrainType) |
| Modifier and Type | Method and Description |
|---|---|
VisibleField |
asVisibleField()
Converts to a VisibleField instance that exposes more details about the field.
|
int |
getIndex() |
Set<Field> |
getNeighbours()
Returns fields that can be reached from this field in one move.
|
Position |
getPosition() |
FieldTerrainType |
getTerrainType() |
Set<VisibleField> |
getVisibleNeighbours()
Same as
getNeighbours() but filtered with isVisible(). |
boolean |
isObstacle()
If the field is not visible, true indicates city or mountain, if the field is visible true indicates only mountain.
|
boolean |
isVisible()
Determines whether in the current round the field is visible or in the fog of war.
|
String |
toString() |
protected final GameStateFieldContext gameStateContext
public Field(GameStateFieldContext gameStateContext, Position position, FieldTerrainType terrainType)
public Position getPosition()
public boolean isVisible()
asVisibleField() method can be used to obtain additional info about this field.public boolean isObstacle()
public VisibleField asVisibleField()
isVisible().public Set<Field> getNeighbours()
public Set<VisibleField> getVisibleNeighbours()
getNeighbours() but filtered with isVisible().public int getIndex()
public FieldTerrainType getTerrainType()
Copyright © 2017. All rights reserved.