示例#1
0
        public override void DrawExtraSelectionOverlays()
        {
            base.DrawExtraSelectionOverlays();
            Blueprint_Install blueprint_Install = InstallBlueprintUtility.ExistingBlueprintFor(this);

            if (blueprint_Install != null)
            {
                GenDraw.DrawLineBetween(this.TrueCenter(), blueprint_Install.TrueCenter());
            }
        }
        public override Job FurnitureJob(Pawn pawn, Building_Bed myBed, Room myRoom)
        {
            if (myRoom == null)
            {
                return(null);
            }

            var movable = new List <Thing>();

            foreach (var thing in myRoom.ContainedAndAdjacentThings)
            {
                if (thing.def.Minifiable &&
                    pawn.CanReserve(thing) &&
                    InstallBlueprintUtility.ExistingBlueprintFor(thing) == null)
                {
                    movable.Add(thing);
                    //consider moving it
                }
            }

            var cells = myRoom.CellsNotNextToDoorCardinal();

            foreach (var thing in movable.InRandomOrder())
            {
                if (thing is Building_Bed)
                {
                    continue;
                }

                if (thing.PlaceThing(pawn, cells,
                                     thing.def.rotatable ? Rot4.Random : Rot4.North,
                                     myRoom, out var furnitureJob1))
                {
                    return(furnitureJob1);
                }
            }

            return(null);
        }
示例#3
0
 private static bool NoPlans(Thing x)
 {
     return(InstallBlueprintUtility.ExistingBlueprintFor(x) == null);
 }