Portable NuGet library/package for navigating on a tile-based 2-dimensional raster/matrix.
- .NET Standard 2.1 or NET 6 or above
Install the NuGet package using the command below:
Install-Package MiNET.astar
... or search for MiNET.astar
in the NuGet index.
The code below is an example how to use the library.
using AStarNavigator;
using AStarNavigator.Algorithms;
using AStarNavigator.Providers;
var navigator = new TileNavigator(
new EmptyBlockedProvider(), // Instance of: IBockedProvider
new DiagonalNeighborProvider(), // Instance of: INeighborProvider
new PythagorasAlgorithm(), // Instance of: IDistanceAlgorithm
new ManhattanHeuristicAlgorithm() // Instance of: IDistanceAlgorithm
);
var from = new Tile(1, 2);
var to = new Tile(20, 22);
var result = navigator.Navigate(from, to);