Package game
Interface SeekState
- All Known Implementing Classes:
GameState
public interface SeekState
The state of the game while finding the ring.
In order to determine the next move, you need to call the various methods
of this interface. To move through the sewer system, you need to call moveTo(long).
An instance provides all the information necessary
to search through the sewer system and find the ring.
-
Method Summary
Modifier and TypeMethodDescriptionlong
Return the unique identifier associated with McDiver's current location.int
Return McDiver's current distance along the grid (NOT THE GRAPH) from the ring.void
moveTo
(long id) Change McDiver's current location to the node given by id.Return an unordered collection of NodeStatus objects associated with all direct neighbors of McDiver's current location.
-
Method Details
-
currentLocation
long currentLocation()Return the unique identifier associated with McDiver's current location. -
neighbors
Collection<NodeStatus> neighbors()Return an unordered collection of NodeStatus objects associated with all direct neighbors of McDiver's current location. Each status contains a unique identifier for the neighboring node as well as the distance of that node to the ring along the grid(NB: This is NOT the distance in the graph, it is only the number of rows and columns away from the ring.)
It is possible to move directly to any node identifier in this collection.
-
distanceToRing
int distanceToRing()Return McDiver's current distance along the grid (NOT THE GRAPH) from the ring. -
moveTo
void moveTo(long id) Change McDiver's current location to the node given by id. Throw an IllegalArgumentException if the node with id id is not adjacent to McDiver's current location.
-