Esempio n. 1
0
    public void UpdatePathingData()
    {
        if (PathfindingOutOfDate == false)
        {
            return;
        }

        _pathData = PathFinding.Dijkstra(PathfindingGraph, Position, Range);

        PointsInRange = Distances.Keys.Where(point => point != Position).ToList();

        PathfindingOutOfDate = false;
    }
Esempio n. 2
0
        private void CalculateDijkstra(object sender, RoutedEventArgs e)
        {
            var dialog = new Dijkstra();

            dialog.ShowDialog();

            int startNode = dialog.StartNode - 1;
            int endNode   = dialog.EndNode - 1;

            List <int> path = PathFinding.Dijkstra(Graph, startNode, endNode);

            string message = "Znaleziona sciezka : " + Environment.NewLine;

            path.ForEach(n => message += (n + 1) + " ");

            MessageBox.Show(message);
        }