예제 #1
0
        public override AcceptanceReport CanDesignateThing(Thing t)
        {
            Building      building = t.GetInnerIfMinified() as Building;
            CompShardable comp     = building.TryGetComp <CompShardable>();

            if (comp == null || comp.shard == null || !Base.ThingIsPrintable(building.def))
            {
                return(false);
            }
            return(base.CanDesignateThing(t));
        }
예제 #2
0
        public static Thing MakeShards(Thing ingredient)
        {
            //ResearchProjectDef rpd = Base.thingDic[ingredient.def];
            //ThingDef shardDef = Techshard(rpd);
            CompShardable comp = ingredient.TryGetComp <CompShardable>();

            if (comp == null)
            {
                Log.Error("Tried to shard thing with no CompShardable");
                return(null);
            }

            ThingDef shardDef = comp.shard;

            Thing thing = ThingMaker.MakeThing(shardDef);

            thing.stackCount = CalcNumShardsFor(ingredient);

            return(thing);
        }