Beispiel #1
0
        public LordJob_JoinableShow(Building_Carn venue, Pawn entertainer)
        {
            this.info = CarnUtils.Info;

            spot = venue.AudienceCentre;

            this.entertainer = entertainer;

            var rotation = venue.Rotation;

            audienceRect = CellRect.CenteredOn(spot, 2);

            switch (rotation.AsByte)
            {
            case 0:
                audienceRect.maxZ--;
                entertainerSpot = spot + IntVec3.North * 2;
                break;

            case 1:
                audienceRect.maxX--;
                entertainerSpot = spot + IntVec3.East * 2;
                break;

            case 2:
                audienceRect.minZ++;
                entertainerSpot = spot + IntVec3.South * 2;
                break;

            case 3:
                audienceRect.minX++;
                entertainerSpot = spot + IntVec3.West * 2;
                break;
            }
        }
Beispiel #2
0
        public bool AssignEntertainerToBuilding(Pawn entertainer, Building_Carn building, bool relieveExistingPawn = false)
        {
            if (entertainer == null || building == null)
            {
                return(false);
            }

            var cell = building.GetAnnouncerCell();

            if (cell.IsValid)
            {
                if (building.assignedPawn != null)
                {
                    if (relieveExistingPawn)
                    {
                        rememberedPositions.Remove(building.assignedPawn);
                        building.assignedPawn = entertainer;
                        rememberedPositions.Add(entertainer, cell);
                        guardPositions.Add(cell);
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    building.assignedPawn = entertainer;
                    rememberedPositions.Add(entertainer, cell);
                    guardPositions.Add(cell);
                    return(true);
                }
            }

            return(false);
        }