コード例 #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
ファイル: ShardMaker.cs プロジェクト: vishalswami/RimWorld
        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);
        }