public void UpdateMap() { availableCells = new Map <Position, int>(() => int.MaxValue); Algorithms.Dijkstra <Position, Pair <Ability, Position>, Ability>( availableCells, unit.Position, p => LunohodeAlgorithms.PossibleMoves(unit, p), a => a.first.cost, a => a.second, solution, a => a.first ); }
public Map <Position, int> Distances() { Map <Position, int> result = new Map <Position, int>(); Algorithms.Dijkstra <Position, Pair <Ability, Position>, int>( result, new Position(current.figure.position, current.directed.direction), p => LunohodeAlgorithms.PossibleMoves(current, p), a => a.first.cost, a => a.second ); return(result); }