Ejemplo n.º 1
0
    public void CopyPlanShipPut(ShipPlan Info)
    {
        m_Canvans.Copy(Info.m_Canvans);

        m_Soldiers.Clear();
        foreach (ShipPutInfo item in Info.m_Soldiers)
        {
            ShipPutInfo newItem = new ShipPutInfo();
            newItem.Copy(item);
            m_Soldiers.Add(newItem);
        }
        m_RoomBuildings.Clear();
        foreach (ShipPutInfo item in Info.m_RoomBuildings)
        {
            ShipPutInfo newItem = new ShipPutInfo();
            newItem.Copy(item);
            m_RoomBuildings.Add(newItem);
        }

        m_StairBuildings.Clear();
        foreach (ShipPutInfo item in Info.m_StairBuildings)
        {
            ShipPutInfo newItem = new ShipPutInfo();
            newItem.Copy(item);
            m_StairBuildings.Add(newItem);
        }

        BlackScienceID = Info.BlackScienceID;
    }
Ejemplo n.º 2
0
    /// <summary>
    ///  备份方案
    /// </summary>
    public void BackupPlan()
    {
        m_BackupCanvas.Copy(m_Canvans);

        m_BackupSoldiers.Clear();
        foreach (ShipPutInfo item in m_Soldiers)
        {
            ShipPutInfo newItem = new ShipPutInfo();
            newItem.Copy(item);
            m_BackupSoldiers.Add(newItem);
        }
        m_BackupRoomBuildings.Clear();
        foreach (ShipPutInfo item in m_RoomBuildings)
        {
            ShipPutInfo newItem = new ShipPutInfo();
            newItem.Copy(item);
            m_BackupRoomBuildings.Add(newItem);
        }

        m_BackupStairBuildings.Clear();
        foreach (ShipPutInfo item in m_StairBuildings)
        {
            ShipPutInfo newItem = new ShipPutInfo();
            newItem.Copy(item);
            m_BackupStairBuildings.Add(newItem);
        }

        m_BackupBlackScienceID = BlackScienceID;
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 创建船体骨架
    /// </summary>
    private static ShipCanvasInfo GetShipBodyMap()
    {
        List <StairInfo> lStair = new List <StairInfo>();

        CmCarbon.GetStairInfo(ref lStair);

        ShipCanvasInfo Info = new ShipCanvasInfo();

        Info.Copy(CmCarbon.GetDefenseMap());

        List <Int2> lCutMapPoint = new List <Int2> ();

        foreach (StairInfo I in lStair)
        {
            //裁剪掉上层
            lCutMapPoint.Add(new Int2(I.Up.Unit / MapGrid.m_UnitRoomGridNum, I.Up.Layer));
        }
        Info.SetStairMap(lCutMapPoint, XYmode.Save2Edit);
        return(Info);
    }