Exemple #1
0
 public void Clear()
 {
     closeNodeList.Clear();
     openNodeList.Clear();
     closeNodeList = null;
     openNodeList  = null;
 }
Exemple #2
0
        public void Init(int startGridX, int startGridY, int endGridX, int endGridY, List <string> block, bool isCalcDiagonal)
        {
            this.startGridX     = startGridX;
            this.startGridY     = startGridY;
            this.endGridX       = endGridX;
            this.endGridY       = endGridY;
            this.blockList      = block;
            this.isCalcDiagonal = isCalcDiagonal;

            closeNodeList = new CloseNodeList();
            openNodeList  = new OpenNodeList();
            resultList.Clear();

            //创建startNode
            startNode = CreateNode(startGridX, startGridY);
            //把第一个node 放入开放表
            openNodeList.AddNode(startNode);
        }