|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.pathfinding.FindPathsFourWay
public class FindPathsFourWay
Title: FindPaths
Description: Performs pathfinding for a map that all paths are based on one of four directions. (Cardinal directions are used)
Copyright: Copyright (c) Feb 11, 2012
Nested Class Summary | |
---|---|
static class |
FindPathsFourWay.TARGETING
|
Constructor Summary | |
---|---|
FindPathsFourWay(MapElement[][][] tiles,
MapSize mapSize,
PathFinding pathFinding)
|
|
FindPathsFourWay(MapElement[][][] tiles,
MapSize mapSize,
PathFinding pathFinding,
FindPathsFourWay.TARGETING targeting)
|
|
FindPathsFourWay(MapElement[][][] tiles,
PathFinding pathFinding,
FindPathsFourWay.TARGETING targeting,
int startX,
int startY,
int endX,
int endY)
Creates a FindPathsFourWay, that will uses the tiles as the
map starting at location startX, startY to
endX, endY to build a Node map. |
|
FindPathsFourWay(MapElement[][][] tiles,
PathFinding pathFinding,
int startX,
int startY,
int endX,
int endY)
|
Method Summary | |
---|---|
java.util.List<Node> |
getNearestNodes(int x,
int y)
This returns one or two nodes. |
Node |
getNode(int x,
int y)
|
NodeLink |
getNodeLinkIfOnSamePath(int firstX,
int firstY,
int secondX,
int secondY)
|
java.util.Map<java.lang.String,Node> |
getNodes()
|
java.util.List<java.lang.String> |
getPathKeysToTarget(int startX,
int startY,
int targetX,
int targetY)
Gets the PathKeys from the start location (x & Y) to the target (targetX & targetY) location. |
java.util.List<java.lang.String> |
getPathKeysToTarget(int startX,
int startY,
int targetX,
int targetY,
int excludeX,
int excludeY)
Gets the PathKeys from the start location (x & Y) to the target (targetX & targetY) location. |
FindPathsFourWay.TARGETING |
getTargeting()
|
boolean |
isAtNode(int x,
int y)
|
void |
setPathFinding(PathFinding pathFinding)
|
void |
setTargeting(FindPathsFourWay.TARGETING targeting)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FindPathsFourWay(MapElement[][][] tiles, MapSize mapSize, PathFinding pathFinding)
public FindPathsFourWay(MapElement[][][] tiles, MapSize mapSize, PathFinding pathFinding, FindPathsFourWay.TARGETING targeting)
public FindPathsFourWay(MapElement[][][] tiles, PathFinding pathFinding, int startX, int startY, int endX, int endY)
public FindPathsFourWay(MapElement[][][] tiles, PathFinding pathFinding, FindPathsFourWay.TARGETING targeting, int startX, int startY, int endX, int endY)
tiles
as the
map starting at location startX, startY
to
endX, endY
to build a Node map. The node map is based on any
location that has three or more adjacent tiles.
tiles
- pathFinding
- targeting
- startX
- startY
- endX
- endY
- Method Detail |
---|
public java.util.List<Node> getNearestNodes(int x, int y)
x
- y
-
public Node getNode(int x, int y)
public NodeLink getNodeLinkIfOnSamePath(int firstX, int firstY, int secondX, int secondY)
public java.util.Map<java.lang.String,Node> getNodes()
public java.util.List<java.lang.String> getPathKeysToTarget(int startX, int startY, int targetX, int targetY)
startX
- startY
- targetX
- targetY
-
public java.util.List<java.lang.String> getPathKeysToTarget(int startX, int startY, int targetX, int targetY, int excludeX, int excludeY)
startX
- startY
- targetX
- targetY
- excludeX
- excludeY
-
public FindPathsFourWay.TARGETING getTargeting()
public boolean isAtNode(int x, int y)
public void setPathFinding(PathFinding pathFinding)
public void setTargeting(FindPathsFourWay.TARGETING targeting)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |