Exemplo n.º 1
0
        private void CheckChangePawnKindName()
        {
            NameSingle nameSingle = this.pawn.Name as NameSingle;

            if (nameSingle != null && nameSingle.Numerical)
            {
                string kindLabel = this.pawn.KindLabel;
                if (!(nameSingle.NameWithoutNumber == kindLabel))
                {
                    int    number = nameSingle.Number;
                    string text   = this.pawn.KindLabel + " " + number;
                    if (!NameUseChecker.NameSingleIsUsed(text))
                    {
                        this.pawn.Name = new NameSingle(text, true);
                    }
                    else
                    {
                        this.pawn.Name = PawnBioAndNameGenerator.GeneratePawnName(this.pawn, NameStyle.Numeric, null);
                    }
                }
            }
        }
        private void CheckChangePawnKindName()
        {
            NameSingle nameSingle = pawn.Name as NameSingle;

            if (nameSingle == null || !nameSingle.Numerical)
            {
                return;
            }
            string kindLabel = pawn.KindLabel;

            if (!(nameSingle.NameWithoutNumber == kindLabel))
            {
                int    number = nameSingle.Number;
                string text   = pawn.KindLabel + " " + number;
                if (!NameUseChecker.NameSingleIsUsed(text))
                {
                    pawn.Name = new NameSingle(text, numerical: true);
                }
                else
                {
                    pawn.Name = PawnBioAndNameGenerator.GeneratePawnName(pawn, NameStyle.Numeric);
                }
            }
        }