public AStarParam(StaticGrid iGrid, DiagonalMovement iDiagonalMovement) { m_searchGrid = iGrid; DiagonalMovement = iDiagonalMovement; m_startNode = null; m_endNode = null; }
public StaticGrid(StaticGrid b) { sbyte[,] tMatrix = new sbyte[b.width, b.height]; for (int widthTrav = 0; widthTrav < b.width; widthTrav++) { for (int heightTrav = 0; heightTrav < b.height; heightTrav++) { tMatrix[widthTrav, heightTrav] = b.GetValueAt(widthTrav, heightTrav); } } this.m_nodes = buildNodes(b.width, b.height, tMatrix); }
public AStarParam(StaticGrid iGrid, Point iStartPos, Point iEndPos, DiagonalMovement iDiagonalMovement) : this(iGrid, iDiagonalMovement) { m_startNode = m_searchGrid.GetNodeAt(iStartPos.X, iStartPos.Y); m_endNode = m_searchGrid.GetNodeAt(iEndPos.X, iEndPos.Y); if (m_startNode == null) { m_startNode = new Node(iStartPos.X, iStartPos.Y, 0); } if (m_endNode == null) { m_endNode = new Node(iEndPos.X, iEndPos.Y, 0); } }
public void Reset(Point iStartPos, Point iEndPos, StaticGrid iSearchGrid = null) { m_startNode = null; m_endNode = null; if (iSearchGrid != null) { m_searchGrid = iSearchGrid; } m_searchGrid.Reset(); m_startNode = m_searchGrid.GetNodeAt(iStartPos.X, iStartPos.Y); m_endNode = m_searchGrid.GetNodeAt(iEndPos.X, iEndPos.Y); if (m_startNode == null) { m_startNode = new Node(iStartPos.X, iStartPos.Y, 0); } if (m_endNode == null) { m_endNode = new Node(iEndPos.X, iEndPos.Y, 0); } }