Ejemplo n.º 1
0
 private void SetCompProps(CompProperties_Milkable compProps, Production p)
 {
     if (compProps != null)
     {
         compProps.milkAmount       = p.Amount;
         compProps.milkIntervalDays = p.IntervalDays;
     }
 }
Ejemplo n.º 2
0
        private List <ThingDef> getProduction(ThingDef from)
        {
            List <ThingDef> allProduction = new List <ThingDef>();

            if (from.race != null)
            {
                if (from.race.meatDef != null)
                {
                    allProduction.Add(from.race.meatDef);
                }
                if (from.race.useMeatFrom != null)
                {
                    allProduction.Add(from.race.meatDef);
                }
                if (from.race.leatherDef != null)
                {
                    allProduction.Add(from.race.leatherDef);
                }
                CompProperties_Milkable milkProp = from.GetCompProperties <CompProperties_Milkable>();
                if (milkProp != null)
                {
                    allProduction.Add(milkProp.milkDef);
                }
                CompProperties_Shearable shearProp = from.GetCompProperties <CompProperties_Shearable>();
                if (shearProp != null)
                {
                    allProduction.Add(shearProp.woolDef);
                }
            }
            if (from.plant != null)
            {
                if (from.plant.harvestedThingDef != null)
                {
                    allProduction.Add(from.plant.harvestedThingDef);
                }
            }
            if (from.building != null)
            {
                if (from.building.mineableThing != null)
                {
                    allProduction.Add(from.building.mineableThing);
                }
            }
            return(allProduction);
        }