Ejemplo n.º 1
0
        public override void SpawnSetup(Map map, bool respawningAfterLoad)
        {
            base.SpawnSetup(map, respawningAfterLoad);

            powerComp     = GetComp <CompPowerTrader>();
            flickableComp = GetComp <CompFlickable>();

            if (inputSettings == null)
            {
                inputSettings = new StorageSettings(this);
                if (def.building.defaultStorageSettings != null)
                {
                    inputSettings.CopyFrom(def.building.defaultStorageSettings);
                }
            }

            printerProperties = def.GetModExtension <PawnCrafterProperties>();

            //Setup 'orderProcessor'
            if (!printerProperties.customOrderProcessor)
            {
                orderProcessor = new ThingOrderProcessor(ingredients, inputSettings);
                if (printerProperties != null)
                {
                    orderProcessor.requestedItems.AddRange(printerProperties.costList);
                }
            }

            AdjustPowerNeed();
        }
Ejemplo n.º 2
0
        public override void SpawnSetup(Map map, bool respawningAfterLoad)
        {
            base.SpawnSetup(map, respawningAfterLoad);

            powerComp     = GetComp <CompPowerTrader>();
            flickableComp = GetComp <CompFlickable>();

            if (inputSettings == null)
            {
                inputSettings = new StorageSettings(this);
                if (def.building.defaultStorageSettings != null)
                {
                    inputSettings.CopyFrom(def.building.defaultStorageSettings);
                }
            }

            printerProperties = def.GetModExtension <PawnCrafterProperties>();

            if (!respawningAfterLoad)
            {
                //Setup 'orderProcessor'
                if (printerProperties == null)
                {
                    orderProcessor = new ThingOrderProcessor(ingredients, inputSettings);
                    orderProcessor.requestedItems.Add(
                        new ThingOrderRequest()
                    {
                        nutrition = true,
                        amount    = requestNutrition
                    });

                    orderProcessor.requestedItems.Add(
                        new ThingOrderRequest()
                    {
                        thingDef = RimWorld.ThingDefOf.Plasteel,
                        amount   = requestPlasteel
                    });

                    orderProcessor.requestedItems.Add(
                        new ThingOrderRequest()
                    {
                        thingDef = RimWorld.ThingDefOf.ComponentIndustrial,
                        amount   = requestComponents
                    });
                }
                else
                {
                    orderProcessor = new ThingOrderProcessor(ingredients, inputSettings);

                    /*if (printerProperties != null)
                     * {
                     *  orderProcessor.requestedItems.AddRange(printerProperties.costList);
                     * }*/
                }
            }
            else
            {
                //orderProcessor = new ThingOrderProcessor(ingredients, inputSettings);
            }

            AdjustPowerNeed();
        }