public class GameState extends java.lang.Object implements ExplorationState, EscapeState
Modifier and Type | Field and Description |
---|---|
static double |
MAX_BONUS |
static int |
MAX_COLS |
static int |
MAX_ROWS |
static double |
MIN_BONUS |
static int |
MIN_COLS |
static int |
MIN_ROWS |
Modifier and Type | Method and Description |
---|---|
long |
getCurrentLocation()
Returns the unique id of the current location.
|
Node |
getCurrentNode()
Return your current location in the graph.
|
int |
getDistanceToTarget()
Returns the distance from your current location to the target location on the map.
|
Node |
getExit()
Return the exit from the cavern.
|
java.util.Collection<NodeStatus> |
getNeighbors()
Returns a collection of NodeStatus objects which contain the unique ID of the node
and the distance from that node to the target.
|
int |
getTimeRemaining()
Return the time remaining to escape from the cavern.
|
java.util.Collection<Node> |
getVertices()
Return all the nodes in the graph, in no particular order.
|
static void |
main(java.lang.String[] args) |
void |
moveTo(long id)
See moveTo(Node<TileData> n)
|
void |
moveTo(Node n)
Attempts to move the explorer from the current position to
the Node n.
|
void |
pickUpGold()
Picks up any gold on the current tile.
|
static int |
runNewGame(long seed,
boolean useGui) |
public static final int MIN_ROWS
public static final int MAX_ROWS
public static final int MIN_COLS
public static final int MAX_COLS
public static final double MIN_BONUS
public static final double MAX_BONUS
public void moveTo(long id)
moveTo
in interface ExplorationState
id
- The Id of the neighboring Node to move topublic long getCurrentLocation()
getCurrentLocation
in interface ExplorationState
public java.util.Collection<NodeStatus> getNeighbors()
getNeighbors
in interface ExplorationState
public int getDistanceToTarget()
getDistanceToTarget
in interface ExplorationState
public Node getCurrentNode()
EscapeState
getCurrentNode
in interface EscapeState
public Node getExit()
EscapeState
getExit
in interface EscapeState
public java.util.Collection<Node> getVertices()
EscapeState
getVertices
in interface EscapeState
public void moveTo(Node n)
moveTo
in interface EscapeState
n
- A neighboring Nodepublic void pickUpGold()
EscapeState
pickUpGold
in interface EscapeState
public int getTimeRemaining()
EscapeState
getTimeRemaining
in interface EscapeState
public static int runNewGame(long seed, boolean useGui)
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException