public class ShortestPathOracle
extends java.lang.Object
| Constructor and Description |
|---|
ShortestPathOracle() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBarrier(char kind,
Pos p,
int len)
Notify ShortestPathOracle of a barrier.
|
char |
getFirstMoveOnShortestPath(Pos mypos,
Dir mydir,
Pos target)
Returns the first "move" on a shortest path.
|
int |
getLengthOfShortestPath(Pos curr,
Pos target)
Returns the length of the shortest path from position curr to position target.
|
char[] |
getShortestPath(Pos curr,
Pos target)
Returns a shortest path from position curr to position target.
|
void |
setBoardSize(int rows,
int cols)
Initializes the ShortestPathOracle to the given board dimensions.
|
public void setBoardSize(int rows,
int cols)
rows - Number of rows on board.cols - Number of cols on board.public void addBarrier(char kind,
Pos p,
int len)
kind - Either 'r' or 'd', the two kinds of barriers in the game.p - The start position of the barrier.len - The length of the barrier.public int getLengthOfShortestPath(Pos curr, Pos target)
public char getFirstMoveOnShortestPath(Pos mypos, Dir mydir, Pos target)
public char[] getShortestPath(Pos curr, Pos target)