Skip to content

WichardRiezebos/astar-navigator

Repository files navigation

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 Framework 3.5

Installation

Install the NuGet package using the command below:

Install-Package AStarNavigator

... or search for AStarNavigator 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);