示例#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;
 }