org.deken.game.pathfinding
Interface Node

All Known Implementing Classes:
NodeFourWay

public interface Node

Title: Node

Description: TODO

Copyright: Copyright (c) Feb 11, 2012

Version:
1.0
Author:
Gary Deken

Method Summary
 void addNode(Node node, int distance, java.util.List<java.lang.String> path)
          Add a connecting Node that is X distance away, with a path containing points.
 void clear()
           
 NodeLink getConnectionFromLocation(int x, int y)
          Gets the NodeLink that contains the given location.
 java.util.List<NodeLink> getConnections()
          Returns the connection nodes with distance to that node.
 int getDistanceFromStart()
          Used by pathfinding, the total distance from the start.
 GameLocation getGameLocation()
          The location of this node as a tile location.
 java.lang.String getLocationKey()
          Returns the Location as a String.
 Node getPathParent()
          Used by pathfinding, gets the node traveled through to get to this node.
 void setDistanceFromStart(int distanceFromStart)
          Used by pathfinding, sets the total distance from the start.
 void setPathParent(Node node)
          Used by pathfinding, sets the node traveled through to get to this node.
 

Method Detail

addNode

void addNode(Node node,
             int distance,
             java.util.List<java.lang.String> path)
Add a connecting Node that is X distance away, with a path containing points.

Parameters:
node -
distance -
path -

clear

void clear()

getConnections

java.util.List<NodeLink> getConnections()
Returns the connection nodes with distance to that node.

Returns:
List

getConnectionFromLocation

NodeLink getConnectionFromLocation(int x,
                                   int y)
Gets the NodeLink that contains the given location. If the location is not in any of the links, null is returned.

Parameters:
x -
y -
Returns:
NodeLink

getDistanceFromStart

int getDistanceFromStart()
Used by pathfinding, the total distance from the start.

Returns:
int

getGameLocation

GameLocation getGameLocation()
The location of this node as a tile location.

Returns:
GameLocation

getLocationKey

java.lang.String getLocationKey()
Returns the Location as a String. This use LocationUtils to build the location key.

Returns:
String

getPathParent

Node getPathParent()
Used by pathfinding, gets the node traveled through to get to this node.

Returns:
Node

setDistanceFromStart

void setDistanceFromStart(int distanceFromStart)
Used by pathfinding, sets the total distance from the start.

Parameters:
distanceFromStart -

setPathParent

void setPathParent(Node node)
Used by pathfinding, sets the node traveled through to get to this node.

Parameters:
node -