Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.37 KB

README.md

File metadata and controls

39 lines (27 loc) · 1.37 KB

AStar Navigator

Build NuGet Join the chat at https://gitter.im/astar-navigator/Lobby

Portable NuGet library/package for navigating on a tile-based 2-dimensional raster/matrix.

Prerequisites

  • .NET Standard 2.1 or NET 6 or above

Installation

Install the NuGet package using the command below:

Install-Package MiNET.astar

... or search for MiNET.astar in the NuGet index.

Getting started

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);