public void StartFindPath(DijkstraNode[] pathfindingNetwork, DefinitionNode[] definitionNodes, int startNodeIndex)
 {
     ResetNetwork(pathfindingNetwork);
     _openSet.AssignArray(pathfindingNetwork);
     _closedSet.Clear();
     _openSet.Add(startNodeIndex);
     pathfindingNetwork[startNodeIndex].Priority = 0f;
 }
Beispiel #2
0
        public void Start(AstarNode[] pathfindingNetwork, DefinitionNode[] definitionNodes, int startNodeIndex, int targetNodeIndex, float neededClearance, PathfindaxCollisionCategory collisionCategory)
        {
            StartNodeIndex      = startNodeIndex;
            TargetNodeIndex     = targetNodeIndex;
            _neededClearance    = neededClearance;
            _collisionCategory  = collisionCategory;
            _pathfindingNetwork = pathfindingNetwork;
            _definitionNodes    = definitionNodes;

            _openSet.AssignArray(pathfindingNetwork);
            _closedSet.Clear();
            _openSet.Add(startNodeIndex);
        }
Beispiel #3
0
        public void Contains(LookupArray lookupArray, int[] indexesToAdd)
        {
            for (int j = 0; j < 256; j++)
            {
                foreach (var i in indexesToAdd)
                {
                    lookupArray.Occupy(i);
                }

                foreach (var i in indexesToAdd)
                {
                    Assert.IsTrue(lookupArray.Contains(i));
                }
                lookupArray.Clear();
                for (int i = 0; i < lookupArray.Capacity; i++)
                {
                    Assert.IsFalse(lookupArray.Contains(i));
                }
            }
        }
Beispiel #4
0
 public void StartFindPath(AstarNode[] pathfindingNetwork, DefinitionNode[] definitionNodes, int startNodeIndex)
 {
     _openSet.AssignArray(pathfindingNetwork);
     _closedSet.Clear();
     _openSet.Add(startNodeIndex);
 }