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)); }
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); }