Esempio n. 1
0
        public void AStar()
        {
            var graph = new GridGraph(8, 8);

            for (int x = 0; x < 8; x++)
            {
                for (int y = 0; y < 8; y++)
                {
                    graph.Edges[x, y] = 255;
                }
            }

            var A = new Vector2i(3, 0);
            var B = new Vector2i(7, 7);

            var search = new GridSearch(8, 8);

            graph.AStarSearch(search, A, B);

            var path = new List <Vector3f>();

            search.GetPath(B, path);

            foreach (var v in path)
            {
                Console.WriteLine(v);
            }
        }