示例#1
0
    /// <summary>
    /// 删除一层的楼梯
    /// </summary>
    private static void DeleteStairInLayer(int layer)
    {
        //获取一层区组
        List <int> l = new List <int>();

        l = GetColumnPutRoom(layer);
        //对一层区组进行连续性分割
        List <Int2> lArea = NDLink.GetContinuousRange(l);

        //
        foreach (Int2 P in lArea)
        {
            DeleteStairAreaStair(layer, P.Layer, P.Unit);
        }
    }
示例#2
0
    /// <summary>
    /// 获取改层需要创造的楼梯位置点。
    /// </summary>
    private static List <Int2> GetStairCreatePoint(int layer)
    {
        List <Int2> lTarget = new List <Int2>();
        //获取一层区组
        List <int> l = new List <int>();

        l = GetColumnPutRoom(layer);
        //对一层区组进行连续性分割
        List <Int2> lArea = NDLink.GetContinuousRange(l);

        //
        foreach (Int2 P in lArea)
        {
            Int2 StairPos = Int2.zero;
            if (CheckStairPoint(layer, P.Layer, P.Unit, ref StairPos) == true)
            {
                lTarget.Add(StairPos);
            }
        }
        return(lTarget);
    }
示例#3
0
    /// <summary>
    /// 获取楼梯活动区域
    /// </summary>
    /// <param name="layer">格子坐标</param>
    /// <param name="unit">格子坐标</param>
    /// <returns>返回的为地图格子坐标范围Int2.Layer为区间开始 Int2.Unit区间结束</returns>
    public static Int2  GetStairActiveArea(int layer, int unit)
    {
        Int2 Area = Int2.zero;
        int  u    = unit / MapGrid.m_UnitRoomGridNum;
        //获取一层区组
        List <int> l = new List <int>();

        l = GetColumnPutRoom(layer);
        //对一层区组进行连续性分割
        List <Int2> lArea = NDLink.GetContinuousRange(l);

        foreach (Int2 Pos in lArea)
        {
            //Int2.Layer为区间开始 Int2.Unit区间结束
            if (Pos.Layer <= u && u <= Pos.Unit)
            {
                Area.Layer = Pos.Layer * MapGrid.m_UnitRoomGridNum;
                Area.Unit  = (Pos.Unit + 1) * MapGrid.m_UnitRoomGridNum;
                break;
            }
        }
        return(Area);
    }