Esempio n. 1
0
        public static void Setup()
        {
            List <ThingDef> thingDefs = DefDatabase <ThingDef> .AllDefsListForReading;

            if (thingDefs.Count > 0)
            {
                int num = 0;
                foreach (ThingDef thingDef in thingDefs)
                {
                    if ((IsBuildingClass(thingDef)) && (IsBillItem(thingDef)))
                    {
                        if (TryAddBestMixComp(thingDef))
                        {
                            num++;
                        }
                    }
                }
                if (num > 0)
                {
                    string Msg = "BestMix.SetupCount".Translate(num.ToString());
                    Log.Message(Msg);
                }
            }

            //dependency injection for custom region processor
            RegionProcessorSubtitution.Initialize(new RegionWork());
        }
Esempio n. 2
0
        public static void Initialize(RegionProcessorSubtitution instance)
        {
            if (singleton != null)
            {
                throw new Exception("RegionProcessorSubtitution should be initialized once! you're calling initializer more than once.");
            }

            singleton = instance;
        }