public void CopyDesign(DroidDesign droidTypeToCopy) { TemplateDroidType = droidTypeToCopy.TemplateDroidType; Body = droidTypeToCopy.Body; Propulsion = droidTypeToCopy.Propulsion; TurretCount = droidTypeToCopy.TurretCount; Turret1 = droidTypeToCopy.Turret1; Turret2 = droidTypeToCopy.Turret2; Turret3 = droidTypeToCopy.Turret3; }
public bool LoadParts(sLoadPartsArgs Args) { var TurretConflict = default(bool); Body = Args.Body; Propulsion = Args.Propulsion; TurretConflict = false; if (Args.Construct != null) { if (Args.Construct.Code != "ZNULLCONSTRUCT") { if (Turret1 != null) { TurretConflict = true; } TurretCount = 1; Turret1 = Args.Construct; } } if (Args.Repair != null) { if (Args.Repair.Code != "ZNULLREPAIR") { if (Turret1 != null) { TurretConflict = true; } TurretCount = 1; Turret1 = Args.Repair; } } if (Args.Brain != null) { if (Args.Brain.Code != "ZNULLBRAIN") { if (Turret1 != null) { TurretConflict = true; } TurretCount = 1; Turret1 = Args.Brain; } } if (Args.Weapon1 != null) { var UseWeapon = default(bool); if (Turret1 != null) { if (Turret1.TurretType == TurretType.Brain) { UseWeapon = false; } else { UseWeapon = true; TurretConflict = true; } } else { UseWeapon = true; } if (UseWeapon) { TurretCount = 1; Turret1 = Args.Weapon1; if (Args.Weapon2 != null) { Turret2 = Args.Weapon2; TurretCount += 1; if (Args.Weapon3 != null) { Turret3 = Args.Weapon3; TurretCount += 1; } } } } if (Args.Sensor != null) { if (Args.Sensor.Location == SensorLocationType.Turret) { if (Turret1 != null) { TurretConflict = true; } TurretCount = 1; Turret1 = Args.Sensor; } } UpdateAttachments(); return(!TurretConflict); //return if all is ok }