public override bool SetWalkableAt(int iX, int iY, bool iWalkable)
        {
            GridPos pos = new GridPos(iX, iY);

            m_nodePool.SetNode(pos, iWalkable);
            if (iWalkable)
            {
                if (iX < m_gridRect.minX || m_notSet)
                {
                    m_gridRect.minX = iX;
                }
                if (iX > m_gridRect.maxX || m_notSet)
                {
                    m_gridRect.maxX = iX;
                }
                if (iY < m_gridRect.minY || m_notSet)
                {
                    m_gridRect.minY = iY;
                }
                if (iY > m_gridRect.maxY || m_notSet)
                {
                    m_gridRect.maxY = iY;
                }
                m_notSet = false;
            }
            else
            {
                if (iX == m_gridRect.minX || iX == m_gridRect.maxX || iY == m_gridRect.minY || iY == m_gridRect.maxY)
                {
                    m_notSet = true;
                }
            }
            return(true);
        }
Exemple #2
0
        public override bool SetWalkableAt(int iX, int iY, bool iWalkable)
        {
            if (!IsInside(iX, iY))
            {
                return(false);
            }
            GridPos pos = new GridPos(iX, iY);

            m_nodePool.SetNode(pos, iWalkable);
            return(true);
        }