public static Dictionary <string, DefInfo> CollectDefInfos()
        {
            var dict = new Dictionary <string, DefInfo>();

            int TypeHash(Type type) => GenText.StableStringHash(type.FullName);

            dict["ThingComp"]            = GetDefInfo(Sync.thingCompTypes, TypeHash);
            dict["Designator"]           = GetDefInfo(Sync.designatorTypes, TypeHash);
            dict["WorldObjectComp"]      = GetDefInfo(Sync.worldObjectCompTypes, TypeHash);
            dict["IStoreSettingsParent"] = GetDefInfo(Sync.storageParents, TypeHash);
            dict["IPlantToGrowSettable"] = GetDefInfo(Sync.plantToGrowSettables, TypeHash);

            foreach (var defType in GenTypes.AllLeafSubclasses(typeof(Def)))
            {
                if (defType.Assembly != typeof(Game).Assembly)
                {
                    continue;
                }
                if (IgnoredVanillaDefTypes.Contains(defType))
                {
                    continue;
                }

                var defs = GenDefDatabase.GetAllDefsInDatabaseForDef(defType);
                dict.Add(defType.Name, GetDefInfo(defs, d => GenText.StableStringHash(d.defName)));
            }

            return(dict);
        }
Example #2
0
        public static void DumpDefTypes()
        {
            foreach (var defType in GenTypes.AllLeafSubclasses(typeof(Def)))
            {
                if (defType.Assembly != typeof(Game).Assembly)
                {
                    continue;
                }
                if (Multiplayer.IgnoredVanillaDefTypes.Contains(defType))
                {
                    continue;
                }

                Log.Warning($"== {defType.Name} ==");
                Log.Message(
                    GenDefDatabase.GetAllDefsInDatabaseForDef(defType)
                    .Select(def => $"{def.defName}")
                    .Join(delimiter: "\n")
                    );
            }
        }