|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.ie.cowbots.util.PathTransformer
public class PathTransformer
auxiliary class that provide static methods to transcode a path on a gridmap between point based and textual direction based representation
Field Summary | |
---|---|
(package private) static java.lang.String[][] |
pEnc
|
Constructor Summary | |
---|---|
PathTransformer()
|
Method Summary | |
---|---|
static int |
getDirectionX(java.lang.String dir)
this method returns the x-component of a direction dir |
static int |
getDirectionY(java.lang.String dir)
this method returns the y-component of a direction dir |
static java.lang.String |
getMove(java.awt.Point p0,
java.awt.Point p1)
returns the movement command equal to the direction represented by two points |
static java.awt.Point |
getNextPoint(java.awt.Point p,
java.lang.String dir)
this method returns the next point from a starting point and an a* direction |
static java.lang.String[] |
getPath(java.util.List<java.awt.Point> path)
this method returns a path in string based representation from a path in point based representation |
static java.util.List<java.awt.Point> |
getPathPoints(java.awt.Point start,
java.lang.String[] astarpath)
this method converts an astar path from a starting point into a list of points (absolute cell coordinates) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static java.lang.String[][] pEnc
Constructor Detail |
---|
public PathTransformer()
Method Detail |
---|
public static int getDirectionX(java.lang.String dir)
dir
- a* direction
public static int getDirectionY(java.lang.String dir)
dir
- a* direction
public static java.awt.Point getNextPoint(java.awt.Point p, java.lang.String dir)
p
- starting pointdir
- direction (north, northwest, etc..)
public static java.util.List<java.awt.Point> getPathPoints(java.awt.Point start, java.lang.String[] astarpath)
start
- starting pointastarpath
- a* caluclated path
public static java.lang.String[] getPath(java.util.List<java.awt.Point> path)
path
- path in point representation
public static java.lang.String getMove(java.awt.Point p0, java.awt.Point p1)
p0
- start pointp1
- end point
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |