namespace MrGameEng.Pathfinding;
/// Neighbor connectivity of a grid.
public enum GridConnectivity
{
/// Orthogonal moves only.
Four = 4,
/// Orthogonal and diagonal moves. Diagonals never cut corners.
Eight = 8,
}
///
/// A grid the pathfinding algorithms operate on. The game implements this over its own
/// world representation (terrain cells, a TileGrid, …) — the pathfinding module
/// never owns world data.
///
public interface IPathGrid
{
/// Grid width in cells.
int Width { get; }
/// Grid height in cells.
int Height { get; }
/// True when the cell can be entered. Out-of-range cells are never queried.
bool IsPassable(int x, int y);
///
/// Cost multiplier for entering the cell, must be ≥ 1 (1 = normal terrain,
/// 3 = swamp three times slower, …). Used by A* and Dijkstra; ignored by BFS.
///
float Cost(int x, int y);
}