Beispiel #1
0
 internal void Setup(Dictionary <string, Dictionary <string, VersionManifestEntry> > customResources)
 {
     foreach (var category in SettingsResourcesTools.Enumerate <CategoryDescriptor>("CCCategories", customResources))
     {
         AddCategory(category);
     }
 }
Beispiel #2
0
 public void Setup(Dictionary <string, Dictionary <string, VersionManifestEntry> > customResources)
 {
     foreach (var unitType in SettingsResourcesTools.Enumerate <TagUnitType>("CCUnitTypes", customResources))
     {
         RegisterUnitType(unitType);
     }
 }
Beispiel #3
0
 internal void Setup(Dictionary <string, Dictionary <string, VersionManifestEntry> > customResources)
 {
     foreach (var tag in SettingsResourcesTools.Enumerate <EquipLocationTag>("CCCEquipLocationTag", customResources))
     {
         Tags[tag.Tag] = tag;
         Control.Log($"LocationTag {tag.Tag} registered");
         if (Control.Settings.DEBUG_ShowLoadedAlLocations)
         {
             Control.Log(tag.ToString());
         }
     }
 }
Beispiel #4
0
 internal void Setup(Dictionary <string, Dictionary <string, VersionManifestEntry> > customResources)
 {
     foreach (var entry in SettingsResourcesTools.Enumerate <DefaultsInfo>("CCDefaults", customResources))
     {
         if (string.IsNullOrEmpty(entry.Tag))
         {
             Defaults.Add(entry);
         }
         else
         {
             TaggedDefaults.Add(entry);
         }
     }
 }
        public void Setup(Dictionary <string, Dictionary <string, VersionManifestEntry> > customResources)
        {
            //SetupDefaults();

            foreach (var hp in SettingsResourcesTools.Enumerate <HardpointInfo>("CCHardpoints", customResources))
            {
                if (hp.Complete())
                {
                    if (Control.Settings.DEBUG_ShowLoadedHardpoints)
                    {
                        Control.Log($"Hardpoint {hp.ID} loaded, [{hp.CompatibleID.Aggregate("", (last, next) => last + " " + WeaponCategoryEnumeration.GetWeaponCategoryByID(next).FriendlyName)}]");
                    }
                    HardpointsByName[hp.ID] = hp;
                    HardpointsByID[hp.WeaponCategory.ID] = hp;
                }
            }
            HardpointsList = HardpointsByName.Values.OrderBy(i => i.CompatibleID.Count).ToList();

            HardpointInfo omni;

            if (HardpointsByID.TryGetValue(Control.Settings.OmniCategoryID, out omni))
            {
                var list = HardpointsList
                           .Where(i => i.Visible && i.AllowOnWeapon)
                           .Select(i => new { name = i.ID, id = i.WeaponCategory.ID })
                           .ToArray();

                omni.CompatibleID = list.Select(i => i.id).ToHashSet();
            }

            if (Control.Settings.DEBUG_ShowLoadedHardpoints)
            {
                Control.Log($"Hardpoints: Total {HardpointsList?.Count ?? 0} Loaded");
                if (omni != null)
                {
                    Control.Log($"- omni list [{omni.CompatibleID.Aggregate("", (last, next) => last + " " + WeaponCategoryEnumeration.GetWeaponCategoryByID(next).FriendlyName)}]");
                }
                else
                {
                    Control.Log("- no omni hardpoint definition load");
                }
            }
        }
Beispiel #6
0
 internal void Setup(Dictionary <string, Dictionary <string, VersionManifestEntry> > customResources)
 {
     Restrictions = SettingsResourcesTools.Enumerate <TagRestrictions>("CCTagRestrictions", customResources)
                    .ToDictionary(entry => entry.Tag);
 }