Exemplo n.º 1
0
        public void RequestPathToItem(ItemType itemType)
        {
            var sourceNodeIndex = _owner.World.graph.FindNearestNode(_owner.VPos).Index;

            _search = new DijkstraSearch(graph: _owner.World.graph, source: sourceNodeIndex, type: itemType);
            _owner.FindPathResult = PathResult.InProgress;
            _owner.World.PathManager.Register(this);
        }
Exemplo n.º 2
0
        public void RequestPathToTarget(Vector2D target)
        {
            var sourceNodeIndex = _owner.World.graph.FindNearestNode(_owner.VPos).Index;
            var targetNodeIndex = _owner.World.graph.FindNearestNode(target).Index;

            _search = new AStarSearch(graph: _owner.World.graph, source: sourceNodeIndex, target: targetNodeIndex);
            _owner.FindPathResult = PathResult.InProgress;
            _owner.World.PathManager.Register(this);
        }