コード例 #1
0
        public static ThingDef RandomPodContentsDef(bool mustBeResource = false)
        {
            IEnumerable <ThingDef> source = ThingSetMaker_BeeResourcePod.PossiblePodContentsDefs();

            if (mustBeResource)
            {
                source = from x in source
                         where x.stackLimit > 1
                         select x;
            }
            int numMeats = (from x in source
                            where x.IsMeat
                            select x).Count <ThingDef>();
            int numLeathers = (from x in source
                               where x.IsLeather
                               select x).Count <ThingDef>();

            return(source.RandomElementByWeight((ThingDef d) => ThingSetMakerUtility.AdjustedBigCategoriesSelectionWeight(d, numMeats, numLeathers)));
        }
コード例 #2
0
 protected override IEnumerable <ThingDef> AllGeneratableThingsDebugSub(ThingSetMakerParams parms)
 {
     return(ThingSetMaker_BeeResourcePod.PossiblePodContentsDefs());
 }