Example #1
0
        public override void PostWorldGenerate()
        {
            int num = 0;

            while (true)
            {
                StartingPawnUtility.ClearAllStartingPawns();
                for (int i = 0; i < this.pawnCount; i++)
                {
                    Find.GameInitData.startingPawns.Add(StartingPawnUtility.NewGeneratedStartingPawn());
                }
                num++;
                if (num > 20)
                {
                    break;
                }
                if (StartingPawnUtility.WorkTypeRequirementsSatisfied())
                {
                    goto Block_3;
                }
            }
            return;

Block_3:
            while (Find.GameInitData.startingPawns.Count < this.pawnChoiceCount)
            {
                Find.GameInitData.startingPawns.Add(StartingPawnUtility.NewGeneratedStartingPawn());
            }
            Find.GameInitData.startingPawnCount = this.pawnCount;
        }
        // Token: 0x06004DA0 RID: 19872 RVA: 0x001A4DAC File Offset: 0x001A2FAC
        public override void PostWorldGenerate()
        {
            if (this.Pawns.NullOrEmpty())
            {
                base.PostWorldGenerate();
                return;
            }
            List <PawnKindDef> kinds = new List <PawnKindDef>();

            foreach (var item in this.Pawns)
            {
                for (int i = 0; i < item.count; i++)
                {
                    kinds.Add(item.kindDef);
                }
            }
            this.pawnCount = kinds.Count;
            Find.GameInitData.startingPawnCount = this.pawnCount;
            int num = 0;

            do
            {
                StartingPawnUtility.ClearAllStartingPawns();
                foreach (var item in kinds)
                {
                    //	Log.Message("Generating "+item);
                    Find.GameInitData.startingAndOptionalPawns.Add(SpecificStartingPawnUtility.NewGeneratedStartingPawn(item));
                }
                num++;
                if (num > 20)
                {
                    break;
                }
            }while (!StartingPawnUtility.WorkTypeRequirementsSatisfied());
IL_62:
            while (Find.GameInitData.startingAndOptionalPawns.Count < this.pawnChoiceCount)
            {
                foreach (var item in kinds)
                {
                    //	Log.Message("Generating " + item);
                    Find.GameInitData.startingAndOptionalPawns.Add(SpecificStartingPawnUtility.NewGeneratedStartingPawn(item));
                }
            }
            return;

            goto IL_62;
        }
        public override void PostWorldGenerate()
        {
            Find.GameInitData.startingPawnCount = pawnCount;
            int num = 0;

            do
            {
                StartingPawnUtility.ClearAllStartingPawns();
                for (int i = 0; i < pawnCount; i++)
                {
                    Find.GameInitData.startingAndOptionalPawns.Add(StartingPawnUtility.NewGeneratedStartingPawn());
                }
                num++;
            }while (num <= 20 && !StartingPawnUtility.WorkTypeRequirementsSatisfied());
            while (Find.GameInitData.startingAndOptionalPawns.Count < pawnChoiceCount)
            {
                Find.GameInitData.startingAndOptionalPawns.Add(StartingPawnUtility.NewGeneratedStartingPawn());
            }
        }