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; }
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; } } }
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; } } }
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; }
public TLink() { node = null; next = null; f = 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; }