Exemplo n.º 1
0
        internal static void SetMechDefAutoFixCategory()
        {
            Fixers.Clear();
            void Add(MechDefAutoFixCategory cat)
            {
                if (cat.AutoFixSetting)
                {
                    Fixers.Add(cat);
                }
            }

            Add(new MechDefAutoFixCategory
            {
                AutoFixMechDef = ArmActuatorHandler.Shared,
                AutoFixSetting = Control.settings.AutoFixMechDefArmActuator,
                CompanyStatKey = "MechEngineer_AutoFixMechDefArmActuator"
            });

            Add(new MechDefAutoFixCategory
            {
                AutoFixMechDef = CockpitHandler.Shared,
                AutoFixSetting = Control.settings.AutoFixMechDefCockpitAdder != null,
                CompanyStatKey = "MechEngineer_AutoFixMechDefCockpit"
            });

            Add(new MechDefAutoFixCategory
            {
                AutoFixMechDef = GyroHandler.Shared,
                AutoFixSetting = Control.settings.AutoFixMechDefGyroAdder != null,
                CompanyStatKey = "MechEngineer_AutoFixMechDefGyro"
            });

            Add(new MechDefAutoFixCategory
            {
                AutoFixMechDef = ArmorHandler.Shared,
                AutoFixSetting = Control.settings.AutoFixMechDefArmorAdder != null,
                CompanyStatKey = "MechEngineer_AutoFixArmor"
            });

            Add(new MechDefAutoFixCategory
            {
                AutoFixMechDef = StructureHandler.Shared,
                AutoFixSetting = Control.settings.AutoFixMechDefStructureAdder != null,
                CompanyStatKey = "MechEngineer_AutoFixStructure"
            });

            Add(new MechDefAutoFixCategory
            {
                AutoFixMechDef = EngineCoreRefHandler.Shared,
                AutoFixSetting = Control.settings.AutoFixMechDefEngine,
                CompanyStatKey = "MechEngineer_AutoFixMechDefEngine"
            });

            Add(new MechDefAutoFixCategory
            {
                AutoFixMechDef = ChassisHandler.Shared,
                AutoFixSetting = Control.settings.AutoFixChassisDefSlotsChanges != null,
                CompanyStatKey = "MechEngineer_AutoFixMechDefByChassisDefSlotsChanges"
            });
        }
Exemplo n.º 2
0
 private ImmutableArray <string> LoadFixableDiagnosticIds()
 {
     return(Fixers
            .SelectMany(f => f.FixableDiagnosticIds)
            .Distinct()
            .OrderBy(f => f)
            .ToImmutableArray());
 }
Exemplo n.º 3
0
 private ImmutableArray <FixAllProvider> LoadFixAllProviders()
 {
     return(Fixers
            .Select(f => f.GetFixAllProvider())
            .Where(f => f != null)
            .Distinct()
            .ToImmutableArray());
 }
Exemplo n.º 4
0
 /// <summary>
 /// Обработка не нормализованной строки адреса.
 /// </summary>
 /// <param name="address"></param>
 public AddressResult Parse(string address)
 {
     foreach (var key in Replaces.Keys.Where(key => address.ToUpperInvariant().Contains(key)))
     {
         address = address.ReplaceIgnoreCase(key, Replaces[key]);
         break;
     }
     if (Replaces.ContainsKey(address.ToUpperInvariant()))
     {
         address = Replaces[address];
     }
     address = Fixers.Aggregate(address, (current, fix) => fix.Fix(current));
     return(new AddressResult(this, address));
 }