Ejemplo n.º 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;
 }
Ejemplo n.º 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;
         }
     }
 }
Ejemplo n.º 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;
                }

            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 5
0
 public TLink()
 {
     node = null;
     next = null;
     f    = 0;
 }
Ejemplo n.º 6
0
 public TLink()
 {
     node = null;
     next = null;
     f = 0;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }