コード例 #1
0
        public override CustomizableBillParameter Clone()
        {
            CustomizableBillParameter_MakeAutomata clone = new CustomizableBillParameter_MakeAutomata();

            clone.appearanceChoices = appearanceChoices.ListFullCopy();
            clone.specialization    = specialization;
            clone.baseMaterial      = baseMaterial;
            clone.ingredients       = new Dictionary <ThingDef, int>(ingredients);

            return(clone);
        }
コード例 #2
0
        private void TryAddBill()
        {
            if (!CheckAllRequirements())
            {
                return;
            }

            Bill_CustomizedProductionWithUft bill = new Bill_CustomizedProductionWithUft(originalRecipeDef);

            var ingredients = new Dictionary <ThingDef, int>();

            ingredients.Add(billWorker.baseMaterial, billWorker.baseMaterialCount);
            if (billWorker.ComponentIndustrialCount > 0)
            {
                ingredients.Add(ThingDefOf.ComponentIndustrial, billWorker.ComponentIndustrialCount);
            }

            if (billWorker.ComponentSpacerCount > 0)
            {
                ingredients.Add(ThingDefOf.ComponentSpacer, billWorker.ComponentSpacerCount);
            }

            if (billWorker.useAIPersonaCore)
            {
                ingredients.Add(ThingDefOf.AIPersonaCore, 1);
            }

            CustomizableBillParameter_MakeAutomata parameter = new CustomizableBillParameter_MakeAutomata()
            {
                appearanceChoices = _samplePawnDrawers.Select(x => new AutomataAppearanceParameter()
                {
                    hairDef = x.HairDef, faceVariantIndex = x.FaceVariantIndex
                }).ToList(),
                specialization = billWorker.selectedSpecialization,
                baseMaterial   = billWorker.baseMaterial,
                ingredients    = ingredients,
            };

            bill.SetParameter(parameter);
            ConfirmBill(bill);

            for (int i = 0; i < _samplePawnDrawers.Length; ++i)
            {
                _samplePawnDrawers[i].Destroy();
            }
        }