zombie.ai.astar
Class AStarPathFinder

java.lang.Object
  extended by zombie.ai.astar.AStarPathFinder

public class AStarPathFinder
extends java.lang.Object

Author:
LEMMY

Nested Class Summary
static class AStarPathFinder.PathFindProgress
           
 
Field Summary
 boolean allowDiagMovement
           
 IsoGameCharacter character
           
 int cyclesPerSlice
           
 int delay
           
static int IDToUseInSort
           
 int maxSearchDistance
           
 java.util.ArrayList<AStarPathMap.Node> NodesUnfurled
           
static int NumPathfinds
           
 AStarPathFinder.PathFindProgress progress
           
 int startX
           
 int startY
           
 int startZ
           
 int targetX
           
 int targetY
           
 int targetZ
           
 
Constructor Summary
AStarPathFinder(IsoGameCharacter character, AStarPathMap finder, int maxSearchDistance, boolean allowDiagMovement, AStarHeuristic heuristic)
           
 
Method Summary
 AStarPathFinder.PathFindProgress Cycle(int threadID)
           
 AStarPathFinder.PathFindProgress Cycle(int threadID, PathfindManager.PathfindJob job)
           
 int enterable(int d, AStarPathMap.Node current, AStarPathMap.Node from)
           
 int enterable(int d, AStarPathMap.Node current, int d2)
           
 Path findPath(int threadID, Mover mover, int sx, int sy, int sz, int tx, int ty, int tz)
           
 Path findPath(int threadID, Mover mover, int sx, int sy, int sz, int tx, int ty, int tz, PathfindManager.PathfindJob job)
           
 AStarPathFinder.PathFindProgress findPathActual(Mover mover, int sx, int sy, int sz, int tx, int ty, int tz)
           
 AStarPathFinder.PathFindProgress findPathActual(Mover mover, int sx, int sy, int sz, int tx, int ty, int tz, boolean bClosest)
           
 void findPathActualZombie(Mover mover, int sx, int sy, int sz, int tx, int ty, int tz)
           
 Path findPathb(int threadID, Mover mover, int sx, int sy, int sz, int tx, int ty, int tz)
           
 AStarPathFinder.PathFindProgress findPathSlice(int threadID, IPathfinder pathfinder, Mover mover, int sx, int sy, int sz, int tx, int ty, int tz)
           
 int getFreeIndex(IsoGameCharacter character)
           
 float getHeuristicCost(Mover mover, int x, int y, int z, int tx, int ty, int tz)
          get the heuristic cost for the given location.
static AStarPathMap.Node getNodeFrom(AStarPathMap.Node current, IsoDirections dir)
           
static AStarPathMap.Node getNodeFrom2(AStarPathMap.Node current, IsoDirections dir)
           
 Path getPath()
           
 AStarPathMap.Node Jump(IsoDirections dir, AStarPathMap.Node start)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDToUseInSort

public static int IDToUseInSort

allowDiagMovement

public boolean allowDiagMovement

cyclesPerSlice

public int cyclesPerSlice

delay

public int delay

maxSearchDistance

public int maxSearchDistance

progress

public AStarPathFinder.PathFindProgress progress

startX

public int startX

startY

public int startY

startZ

public int startZ

targetX

public int targetX

targetY

public int targetY

targetZ

public int targetZ

NumPathfinds

public static int NumPathfinds

character

public IsoGameCharacter character

NodesUnfurled

public java.util.ArrayList<AStarPathMap.Node> NodesUnfurled
Constructor Detail

AStarPathFinder

public AStarPathFinder(IsoGameCharacter character,
                       AStarPathMap finder,
                       int maxSearchDistance,
                       boolean allowDiagMovement,
                       AStarHeuristic heuristic)
Method Detail

getNodeFrom

public static AStarPathMap.Node getNodeFrom(AStarPathMap.Node current,
                                            IsoDirections dir)

getNodeFrom2

public static AStarPathMap.Node getNodeFrom2(AStarPathMap.Node current,
                                             IsoDirections dir)

enterable

public int enterable(int d,
                     AStarPathMap.Node current,
                     int d2)

enterable

public int enterable(int d,
                     AStarPathMap.Node current,
                     AStarPathMap.Node from)

Jump

public AStarPathMap.Node Jump(IsoDirections dir,
                              AStarPathMap.Node start)

findPathActualZombie

public void findPathActualZombie(Mover mover,
                                 int sx,
                                 int sy,
                                 int sz,
                                 int tx,
                                 int ty,
                                 int tz)

Cycle

public AStarPathFinder.PathFindProgress Cycle(int threadID)

Cycle

public AStarPathFinder.PathFindProgress Cycle(int threadID,
                                              PathfindManager.PathfindJob job)

findPath

public Path findPath(int threadID,
                     Mover mover,
                     int sx,
                     int sy,
                     int sz,
                     int tx,
                     int ty,
                     int tz)

findPath

public Path findPath(int threadID,
                     Mover mover,
                     int sx,
                     int sy,
                     int sz,
                     int tx,
                     int ty,
                     int tz,
                     PathfindManager.PathfindJob job)

findPathb

public Path findPathb(int threadID,
                      Mover mover,
                      int sx,
                      int sy,
                      int sz,
                      int tx,
                      int ty,
                      int tz)

findPathActual

public AStarPathFinder.PathFindProgress findPathActual(Mover mover,
                                                       int sx,
                                                       int sy,
                                                       int sz,
                                                       int tx,
                                                       int ty,
                                                       int tz)

findPathActual

public AStarPathFinder.PathFindProgress findPathActual(Mover mover,
                                                       int sx,
                                                       int sy,
                                                       int sz,
                                                       int tx,
                                                       int ty,
                                                       int tz,
                                                       boolean bClosest)

findPathSlice

public AStarPathFinder.PathFindProgress findPathSlice(int threadID,
                                                      IPathfinder pathfinder,
                                                      Mover mover,
                                                      int sx,
                                                      int sy,
                                                      int sz,
                                                      int tx,
                                                      int ty,
                                                      int tz)

getFreeIndex

public int getFreeIndex(IsoGameCharacter character)

getHeuristicCost

public float getHeuristicCost(Mover mover,
                              int x,
                              int y,
                              int z,
                              int tx,
                              int ty,
                              int tz)
get the heuristic cost for the given location. This determines in which order the locations are processed.

Parameters:
mover - The entity that is being moved
x - The x coordinate of the tile whose cost is being determined
y - The y coordiante of the tile whose cost is being determined
tx - The x coordinate of the target location
ty - The y coordinate of the target location
Returns:
The heuristic cost assigned to the tile

getPath

public Path getPath()