Exemplo n.º 1
0
        private static void GenerateImplicitRaces()
        {
            try
            {
                List <ThingDef> genRaces = new List <ThingDef>();

                foreach (ThingDef_AlienRace thingDefAlienRace in RaceGenerator.ImplicitRaces)
                {
                    var race = (ThingDef)thingDefAlienRace;
                    genRaces.Add(race);
                    DefGenerator.AddImpliedDef(race);
                    DefGenerator.AddImpliedDef(thingDefAlienRace);
                }

                object[] tmpArr = new object[2];

                tmpArr[1] = typeof(ThingDef);
                foreach (ThingDef thingDef in genRaces)
                {
                    tmpArr[0] = thingDef;
                    GiveHashMethod.Invoke(null, tmpArr);
                }
            }
            catch (MissingMethodException e)
            {
                throw new
                      ModInitializationException($"caught missing method exception while generating implicit races! is HAR up to date?",
                                                 e);
            }
        }
Exemplo n.º 2
0
        private static void GiveShortHash(ThingDef def)

        {
            _tmpArr[0] = def;
            GiveHashMethod.Invoke(null, _tmpArr);
        }