In depth explanation
AnyPath was designed to be as modular as possible. Because all of the heavy lifting is done in Burst compiled jobs, there are a few limitations to what subset of C# AnyPath can use. One of these is that we can not use classes, so we can't use inheritance. The way AnyPath circumvents this limitation while still remaining modular is by using structs that implement interfaces. Every component is passed in as a generic type parameter and as such, the burst compiler can generate very fast code as if the code contained in these structs was there in the function itself.
This does result in a lot of generic type parameters however, luckily, there is the Code Generation utility to assist with defining which components you need for your project.
If you don't use ECS, the AnyPath.Managed finders combined with code generation hide all this complexity for you.
Here's an overview of the components that make up AnyPath:
Graph <TGraph>
Defines a graph data structure that can be used to perform pathfinding queries on.
Nodes <TNode>
The nodes that make up the graph. The only constraint is that a node has to implement IEquatable
Heuristic Provider <TH>
Allows for plugging in a function that provides a cost estimate between two nodes.
Edge Modifier <TMod>
Allows for plugging in a function that alters the cost for an edge between two nodes, without requiring to update the entire graph.
Path Processor <TProc>
After the A* algorithm has found a sequence of nodes that make up the path, it is fed to the path processor. Here, additional processing can be performed on the path. An example of this would be converting a sequence of triangles into a list of corner points.
Segment <TSeg>
Specifies the output type for final path. In simple cases, this can be the same type as the nodes if no path processing is performed. But this can be of any type, as long as the path processer provides the conversion from the list of nodes to the list of path segments.