Ejemplo n.º 1
0
            object ICloneable.Clone()
            {
                var clone = (NightWarInfo)MemberwiseClone();

                clone.ZwEnemyShips = ZwEnemyShips.DeepCloneArray();
                clone.ZwOurShips   = ZwOurShips.DeepCloneArray();
                clone.ZwBombard    = ZwBombard.DeepCloneArray().ForEach(x => x._parent = clone);
                return(clone);
            }
        object ICloneable.Clone()
        {
            var clone = (BattleProcess)MemberwiseClone();

            clone.ZwEnemyShips  = ZwEnemyShips.DeepCloneArray();
            clone.ZwOurShips    = ZwOurShips.DeepCloneArray();
            clone.ZwOurEscort   = ZwOurEscort.DeepCloneArray();
            clone.ZwAirWarfare  = ZwAirWarfare.Clone();
            clone.ZwAirWarfare2 = ZwAirWarfare2.Clone();
            clone.ZwNightWar    = ZwNightWar.Clone();
            clone.ZwSupport     = ZwSupport.Clone();

            clone.ZwOpeningTorpedoAttack = ZwOpeningTorpedoAttack.DeepCloneArray().ForEach(x => x._parent = clone);
            clone.ZwBombardRound1        = ZwBombardRound1.DeepCloneArray().ForEach(xx => xx._parent = clone);
            clone.ZwBombardRound2        = ZwBombardRound2.DeepCloneArray().ForEach(xx => xx._parent = clone);
            clone.ZwBombardRound3        = ZwBombardRound3.DeepCloneArray().ForEach(xx => xx._parent = clone);
            clone.ZwClosingTorpedoAttack = ZwClosingTorpedoAttack.DeepCloneArray().ForEach(x => x._parent = clone);

            if (clone.ZwSupport != null)
            {
                clone.ZwSupport.ZwAttackInfo._parent = clone;
            }

            if (clone.NightWar != null)
            {
                clone.NightWar._parent = clone;
            }

            if (clone.ZwAirWarfare != null)
            {
                clone.ZwAirWarfare._parent = clone;
            }

            if (clone.ZwAirWarfare2 != null)
            {
                clone.ZwAirWarfare2._parent = clone;
            }

            clone.ZwOurShipBattleEndHp   = null;
            clone.ZwEnemyShipBattleEndHp = null;
            clone.ZwOurEscortBattleEndHp = null;

            return(clone);
        }