예제 #1
0
        public void CloseNode(AStarNode node)
        {
            UInt32 pos = GetNodeIndex(node);
            if (pos >= 512) {
                Console.WriteLine("closeNodePosition failed.....");
                return;
            }

            openNodes[(int)pos] = false;
        }
예제 #2
0
        public AStarNodes()
        {
            nodes = new AStarNode[512];
            for (int i = 0; i < 512; i++) {
                nodes[i] = new AStarNode();
            }

            curNode = 0;
            openNodes.SetAll(false);
        }
예제 #3
0
 public void OpenNode(AStarNode node)
 {
     UInt32 pos = GetNodeIndex(node);
     if (pos >= 512) {
         Console.WriteLine("openNode pos failed");
         return;
     }
     openNodes[(int)pos] = false;
 }
예제 #4
0
 public uint GetNodeIndex(AStarNode node)
 {
     for (uint i = 0; i < 512; i++) {
         if (nodes[i] == node)
             return i;
     }
     return 520;
 }