public override object Clone() { ComponentJumpJet retval = base.Clone() as ComponentJumpJet; retval.Improved = Improved; return(retval); }
public static void ResolveComponent(Design design) { //TM212: foreach (HitLocation location in design.HitLocations) { BattleMechHitLocation bmhl = location as BattleMechHitLocation; List <CriticalSlot> slots = new List <CriticalSlot>(); List <ComponentJumpJet> jumpJets = ComponentJumpJet.GetCanonicalJumpJets(); foreach (CriticalSlot criticalSlot in bmhl.CriticalSlots) { foreach (ComponentJumpJet componentJumpJet in jumpJets) { if (Utilities.IsSynonymFor(componentJumpJet, criticalSlot.Label)) { slots.Add(criticalSlot); } } } int iComponentSlots = slots.Count; for (int i = 0; i < slots.Count; i++) { if (slots.Count > 0) { foreach (ComponentJumpJet componentJumpJet in jumpJets) { if (Utilities.IsSynonymFor(componentJumpJet, slots[i].Label)) { if (iComponentSlots >= componentJumpJet.CriticalSpaceMech.Value) { iComponentSlots -= componentJumpJet.CriticalSpaceMech.Value; ComponentJumpJet jumpjet = componentJumpJet.Clone() as ComponentJumpJet; jumpjet.Configure(design); UnitComponent uc = new UnitComponent(jumpjet, bmhl); design.Components.Add(uc); } } } } } } }