Beispiel #1
0
        public PathGraph GenerateMap()
        {
            _pointToNode.Clear();
            _gold.Clear();

            MarkerTheBoard();
            FindLinks();

            var graph = new PathGraph();

            foreach (var node in _pointToNode.Values)
            {
                graph.Nodes.Add(node);
            }

            var test = _board.GetMyPosition();

            return(graph);
        }
Beispiel #2
0
        private PathGraph GetPathFromTarget(ref PathNode target)
        {
            if (target.Source == null)
            {
                return(null);
            }

            var graph = new PathGraph();

            graph.Nodes.Add(target);
            var node = new PathNode();

            node = target.Source;
            do
            {
                graph.Nodes.Add(node);
                node = node.Source;
            } while (node != null);

            return(graph);
        }