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 == enumTurretType.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 == Sensor.enumLocation.Turret ) { if ( Turret1 != null ) { TurretConflict = true; } TurretCount = 1; Turret1 = Args.Sensor; } } UpdateAttachments(); return !TurretConflict; //return if all is ok }
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; }