Pathfindax
Class that implements the A* algorithm for grids to find paths
Interface for classes that implement algorithms to find a path.
Finds a path from .PathStart to .PathEnd using the and returns this as a list of .
The in which the pathfinding will be done
The that contains the info needed such as the start and end of the path
A list of nodes in the defining the path
Class that implements the A* algorithm to find paths
A array class that provides both single dimensional and 2-dimensional access to a array.
The length of the internal array
The width of the array in items
The height of the array in items
Provides access to the internal array with a 2-dimensional indexer
Provides access to the internal array with the standard indexer
Creates a new
The width of the array in items
The height of the array in items
Interface for objects that will be used in a
The index of the item in the
A fast minheap that is used as a priority queue for pathfinding.
The current amount of items in the heap.
Creates a new . The max amount of items in the heap is equal to
Adds the item to the heap
If the interal array is full
Removes the first item from the heap. Since this is a minheap it will have the lowest value which is determined by the implementation of the interface.
Returns true if this heap contains the
Contains data specific for the A* algorithm.
Do not share this between threads.
Creates a new instance of the
A node network for s
Returns the node closest to this position
Returns a preconfigured which can be used to make a
Calculates the clearances up to a maximum
Generate no neighbours.
Generate neighbours except diagonal neighbours
Generate all neighbours
Generic interface for nodenetworks
Interface for nodenetworks
The amount of nodes in this
Generic interface for sourcenodenetworks
Gets the node closest to this position
Interface for sourcenodenetworks
Returns the node closest to this position
Interface for classes that can provide which will be used as base information for other nodenetworks when for pathfinding
Generates the
The
Class that holds nodegrid data which wont change and is safe to share between threads
The connections to other nodes.
Used to map from the source nodes to the nodes where the actual pathfinding is done.
Represents a node that can be used with the A* algorithm.
Used to retrace the path in the A* algorithm.
The cost calculated by the A* heuristic
The cost to the targetnode
The movement penalty for this node. This can be used to make the pathfinder try to avoid certain nodes.
Represents a gridnode that can be used with the A* algorithm.
Used to retrace the path in the A* algorithm.
The cost calculated by the A* heuristic
The cost to the targetnode
Calculates the true clearance from the for the given and returns this.
The stored clearances. Note that this is not the real clearance but a efficient way of storing them.
Call if you want the real clearance
The movement penalty for this node. This can be used to make the pathfinder try to avoid certain nodes.
The X position in the grid in nodes
The Y position in the grid in nodes
The absolute world position
The movement penalty for this node. This can be used to make the pathfinder try to avoid certain nodes.
Represents a connection to another
The where this connection is going to.
The collisions in this connection
Creates a new .
The where this connection is going to
The of this
Helper class for grid clearances
Calculates the offset for grid based clearance
The request that was made.
The path.
This will process any completedpaths.
Starts the pathfinder.
Stops the pathfinder.
Requests a path.
Provides multithreading functionality using a producer consumer queue
Creates a new
Each thread will use its own
The algorithm that will be used to find a path
The post processes that will be applied after the path has been found
Starts giving the pathfinders paths to solve if there are any
Stops giving the pathfinders paths to solve if there are any
Requests a path
Calls the callbacks on the s and removes them from the completed queue.
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Processes a and returns a
Initialises a new with a and optional post processing steps.
The that will be used to solve paths
The that will be used to solve paths
The post processing steps that will be applied after the found a path
Solves a
A object containing the solved path if succesful/>
A class with all the information needed to calculate a path from A to B.
The node start node.
The end node.
The size of the agent. 1 is the default value meaning that the agent occupies only 1 node.
The CollisionLayer. Sometimes you can have multiple nodenetworks. One for agents that have to move over land and one for agents that can move over land and sea for instance.
The callback that will be called after the pathfinder finds a path or cannot find one.
Creates a new
The callback that will be called with the when the pathfinder has finished this
The worldcoordinates of the start of the path
The worldcoordinates of the end of the path
The size of the agent in nodes
The collision layers that this agent cannot cross
A simple struct to store a x and y coord.
Queues items and processes them with one or multiple threads
Initializes a new
A list with IProcessers that will do the actual work. The max amount of threads used it equal to the amount of in the list.
Starts checking the queue for work to do
Stops checking the queue for work to do
Enqueues a new work item in the queue.
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Class for doing work on a dedicated thread
True if this is doing work.
Creates a new worker that will start doing its work on a dedicated thread.
Starts the worker
Starts working on a work item on a dedicated thread
The work item
True if the worker was not busy and the work was accepted