예제 #1
0
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                switch (num)
                {
                case 0u:
                    mapParent = (this.parent as MapParent);
                    if (mapParent.HasMap && mapParent.Faction == Faction.OfPlayer)
                    {
                        this.$current = SettlementAbandonUtility.AbandonCommand(mapParent);
                        if (!this.$disposing)
                        {
                            this.$PC = 1;
                        }
                        return(true);
                    }
                    break;

                case 1u:
                    break;

                default:
                    return(false);
                }
                this.$PC = -1;
                return(false);
            }
예제 #2
0
        public override IEnumerable <Gizmo> GetGizmos()
        {
            MapParent mapParent = parent as MapParent;

            if (mapParent.HasMap && mapParent.Faction == Faction.OfPlayer)
            {
                yield return(SettlementAbandonUtility.AbandonCommand(mapParent));
            }
        }
        private static void Abandon(MapParent settlement)
        {
            Find.WorldObjects.Remove(settlement);
            Settlement settlement2 = settlement as Settlement;

            if (settlement2 != null)
            {
                SettlementAbandonUtility.AddAbandonedSettlement(settlement2);
            }
            Find.GameEnder.CheckOrUpdateGameOver();
        }
예제 #4
0
        private static void Abandon(MapParent settlement)
        {
            Find.WorldObjects.Remove(settlement);
            FactionBase factionBase = settlement as FactionBase;

            if (factionBase != null)
            {
                SettlementAbandonUtility.AddAbandonedBase(factionBase);
            }
            Find.GameEnder.CheckOrUpdateGameOver();
        }
예제 #5
0
        public override IEnumerable <Gizmo> GetGizmos()
        {
            MapParent mapParent = parent as MapParent;

            if (mapParent.HasMap && mapParent.Faction == Faction.OfPlayer)
            {
                yield return((Gizmo)SettlementAbandonUtility.AbandonCommand(mapParent));

                /*Error: Unable to find new state assignment for yield return*/;
            }
        }
        public static void TryAbandonViaInterface(MapParent settlement)
        {
            Map map = settlement.Map;

            if (map == null)
            {
                SettlementAbandonUtility.Abandon(settlement);
                SoundDefOf.Tick_High.PlayOneShotOnCamera(null);
            }
            else
            {
                StringBuilder      stringBuilder = new StringBuilder();
                IEnumerable <Pawn> source        = map.mapPawns.PawnsInFaction(Faction.OfPlayer);
                if (source.Count <Pawn>() != 0)
                {
                    StringBuilder stringBuilder2 = new StringBuilder();
                    foreach (Pawn current in from x in source
                             orderby x.IsColonist descending
                             select x)
                    {
                        if (stringBuilder2.Length > 0)
                        {
                            stringBuilder2.AppendLine();
                        }
                        stringBuilder2.Append("    " + current.LabelCap);
                    }
                    stringBuilder.Append("ConfirmAbandonHomeWithColonyPawns".Translate(new object[]
                    {
                        stringBuilder2
                    }));
                }
                PawnDiedOrDownedThoughtsUtility.BuildMoodThoughtsListString(map.mapPawns.AllPawns, PawnDiedOrDownedThoughtsKind.Banished, stringBuilder, null, "\n\n" + "ConfirmAbandonHomeNegativeThoughts_Everyone".Translate(), "ConfirmAbandonHomeNegativeThoughts");
                if (stringBuilder.Length == 0)
                {
                    SettlementAbandonUtility.Abandon(settlement);
                    SoundDefOf.Tick_High.PlayOneShotOnCamera(null);
                }
                else
                {
                    Find.WindowStack.Add(Dialog_MessageBox.CreateConfirmation(stringBuilder.ToString(), delegate
                    {
                        SettlementAbandonUtility.Abandon(settlement);
                    }, false, null));
                }
            }
        }
예제 #7
0
        public static Command AbandonCommand(MapParent settlement)
        {
            Command_Action command_Action = new Command_Action();

            command_Action.defaultLabel = "CommandAbandonHome".Translate();
            command_Action.defaultDesc  = "CommandAbandonHomeDesc".Translate();
            command_Action.icon         = SettlementAbandonUtility.AbandonCommandTex;
            command_Action.action       = delegate
            {
                SettlementAbandonUtility.TryAbandonViaInterface(settlement);
            };
            if (SettlementAbandonUtility.AllColonistsThere(settlement))
            {
                command_Action.Disable("CommandAbandonHomeFailAllColonistsThere".Translate());
            }
            return(command_Action);
        }
 internal void <> m__0()
 {
     SettlementAbandonUtility.TryAbandonViaInterface(this.settlement);
 }