Beispiel #1
0
 public BaseGrid(BaseGrid b)
 {
     m_gridRect = new GridCube(b.m_gridRect);
     width      = b.width;
     length     = b.length;
     height     = b.height;
 }
Beispiel #2
0
        public ParamBase(BaseGrid iGrid, DiagonalMovement iDiagonalMovement, HeuristicMode iMode)
        {
            SetHeuristic(iMode);

            m_searchGrid     = iGrid;
            DiagonalMovement = iDiagonalMovement;
            m_startNode      = null;
            m_endNode        = null;
        }
Beispiel #3
0
 public ParamBase(BaseGrid iGrid, GridPos iStartPos, GridPos iEndPos, DiagonalMovement iDiagonalMovement, HeuristicMode iMode)
     : this(iGrid, iDiagonalMovement, iMode)
 {
     m_startNode = m_searchGrid.GetNodeAt(iStartPos.x, iStartPos.y, iStartPos.z);
     m_endNode   = m_searchGrid.GetNodeAt(iEndPos.x, iEndPos.y, iEndPos.z);
     if (m_startNode == null)
     {
         m_startNode = new Node(iStartPos.x, iStartPos.y, iStartPos.z, true);
     }
     if (m_endNode == null)
     {
         m_endNode = new Node(iEndPos.x, iEndPos.y, iStartPos.z, true);
     }
 }
Beispiel #4
0
        public void Reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null)
        {
            _reset(iStartPos, iEndPos, iSearchGrid);
            m_startNode = null;
            m_endNode   = null;

            if (iSearchGrid != null)
            {
                m_searchGrid = iSearchGrid;
            }
            m_searchGrid.Reset();
            m_startNode = m_searchGrid.GetNodeAt(iStartPos.x, iStartPos.y, iStartPos.z);
            m_endNode   = m_searchGrid.GetNodeAt(iEndPos.x, iEndPos.y, iEndPos.z);
            if (m_startNode == null)
            {
                m_startNode = new Node(iStartPos.x, iStartPos.y, iStartPos.z, true);
            }
            if (m_endNode == null)
            {
                m_endNode = new Node(iEndPos.x, iEndPos.y, iStartPos.z, true);
            }
        }
Beispiel #5
0
 internal abstract void _reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null);
Beispiel #6
0
        internal override void _reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null)
        {

        }
Beispiel #7
0
 public AStarParam(BaseGrid iGrid, float iweight, DiagonalMovement iDiagonalMovement = DiagonalMovement.Always, HeuristicMode iMode = HeuristicMode.EUCLIDEAN)
     : base(iGrid, iDiagonalMovement, iMode)
 {
     Weight = iweight;
 }