|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectzombie.ai.astar.Path
public class Path
A path determined by some path finding algorithm. A series of steps from the starting location to the target location. This includes a step for the initial location.
Nested Class Summary | |
---|---|
static class |
Path.Step
A single step within the path |
Field Summary | |
---|---|
float |
cost
|
static java.util.Stack<Path.Step> |
stepstore
|
Constructor Summary | |
---|---|
Path()
Create an empty path |
Method Summary | |
---|---|
void |
appendStep(int x,
int y,
int z)
Append a step to the path. |
boolean |
contains(int x,
int y,
int z)
|
float |
costPerStep()
|
static Path.Step |
createStep()
|
int |
getLength()
get the length of the path, i.e. |
Path.Step |
getStep(int index)
get the step at a given index in the path |
int |
getX(int index)
get the x coordinate for the step at the given index |
int |
getY(int index)
get the y coordinate for the step at the given index |
int |
getZ(int index)
|
void |
prependStep(int x,
int y,
int z)
Prepend a step to the path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float cost
public static java.util.Stack<Path.Step> stepstore
Constructor Detail |
---|
public Path()
Method Detail |
---|
public float costPerStep()
public void appendStep(int x, int y, int z)
x
- The x coordinate of the new stepy
- The y coordinate of the new steppublic boolean contains(int x, int y, int z)
public int getLength()
public Path.Step getStep(int index)
index
- The index of the step to retrieve. Note this should
be >= 0 and < getLength();
public int getX(int index)
index
- The index of the step whose x coordinate should be retrieved
public int getY(int index)
index
- The index of the step whose y coordinate should be retrieved
public int getZ(int index)
public static Path.Step createStep()
public void prependStep(int x, int y, int z)
x
- The x coordinate of the new stepy
- The y coordinate of the new step
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |