Beispiel #1
0
 private void Init_Queue()
 {
     Queue           = new TLink();
     Queue.node      = null;
     Queue.f         = -1;
     Queue.next      = new TLink();
     Queue.next.f    = 0xfffffff;
     Queue.next.node = null;
     Queue.next.next = null;
 }
Beispiel #2
0
 private uint[] mPassPoint; //有些地图是没有怪物的- 就不要浪费内存了 等需要寻路的时候再new 申请内存 2015.11.14
 public MapPath(uint nWidth, uint nHeight)
 {
     Queue      = new TLink();
     Width      = nWidth;
     Height     = nHeight;
     mMapData   = new byte[nHeight, nWidth];
     mPassPoint = null;
     for (int i = 0; i < Height; i++)
     {
         for (int j = 0; j < Width; j++)
         {
             mMapData[i, j] = MASK_OPEN;
         }
     }
 }
Beispiel #3
0
        public MapPath(uint nWidth, uint nHeight)
        {
            Queue = new TLink();
            Width = nWidth;
            Height = nHeight;
            mMapData = new byte[nHeight, nWidth];
            mPassPoint = null;
            for (int i = 0; i < Height; i++)
            {
                for (int j = 0; j < Width; j++)
                {
                    mMapData[i, j] = MASK_OPEN;
                }

            }
        }
Beispiel #4
0
        private void Enter_Queue(TTree node, int f)
        {
            TLink p      = Queue;
            TLink Father = p;

            while (f > p.f)
            {
                Father = p;
                p      = p.next;
                if (p == null)
                {
                    break;
                }
            }
            TLink q = new TLink();

            q.f         = f;
            q.node      = node;
            q.next      = p;
            Father.next = q;
        }
Beispiel #5
0
 public TLink()
 {
     node = null;
     next = null;
     f    = 0;
 }
Beispiel #6
0
 public TLink()
 {
     node = null;
     next = null;
     f = 0;
 }
Beispiel #7
0
 private void Init_Queue()
 {
     Queue = new TLink();
     Queue.node = null;
     Queue.f = -1;
     Queue.next = new TLink();
     Queue.next.f = 0xfffffff;
     Queue.next.node = null;
     Queue.next.next = null;
 }
Beispiel #8
0
 private void Enter_Queue(TTree node, int f)
 {
     TLink p = Queue;
     TLink Father = p;
     while (f > p.f)
     {
         Father = p;
         p = p.next;
         if (p == null) break;
     }
     TLink q = new TLink();
     q.f = f;
     q.node = node;
     q.next = p;
     Father.next = q;
 }