示例#1
0
 public ParamBase(BaseGrid iGrid, GridPos iStartPos, GridPos iEndPos, DiagonalMovement iDiagonalMovement, HeuristicMode iMode) : this(iGrid, iDiagonalMovement, iMode)
 {
     MStartNode = MSearchGrid.GetNodeAt(iStartPos.X, iStartPos.Y);
     MEndNode   = MSearchGrid.GetNodeAt(iEndPos.X, iEndPos.Y);
     if (MStartNode == null)
     {
         MStartNode = new Node(iStartPos.X, iStartPos.Y, true);
     }
     if (MEndNode == null)
     {
         MEndNode = new Node(iEndPos.X, iEndPos.Y, true);
     }
 }
示例#2
0
        public void Reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null)
        {
            _reset(iStartPos, iEndPos, iSearchGrid);
            MStartNode = null;
            MEndNode   = null;

            if (iSearchGrid != null)
            {
                MSearchGrid = iSearchGrid;
            }
            MSearchGrid.Reset();
            MStartNode = MSearchGrid.GetNodeAt(iStartPos.X, iStartPos.Y);
            MEndNode   = MSearchGrid.GetNodeAt(iEndPos.X, iEndPos.Y);
            if (MStartNode == null)
            {
                MStartNode = new Node(iStartPos.X, iStartPos.Y, true);
            }
            if (MEndNode == null)
            {
                MEndNode = new Node(iEndPos.X, iEndPos.Y, true);
            }
        }