예제 #1
0
 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
         );
 }
예제 #2
0
    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);
    }