Exemplo n.º 1
0
        public string getTitles()
        {
            if (unit != null)
            {
                if (isMale)
                {
                    return(unit.getTitleM());
                }
                return(unit.getTitleF());
            }
            double bestPrestige = 0;
            Title  bestTitle    = null;

            foreach (Title t in titles)
            {
                if (t.getPrestige() > bestPrestige)
                {
                    bestPrestige = t.getPrestige();
                    bestTitle    = t;
                }
            }
            if (isMale)
            {
                if (bestTitle != null)
                {
                    return(bestTitle.nameM);
                }
                if (title_land != null)
                {
                    return(title_land.titleM);
                }
                return("Lord");
            }
            else
            {
                if (bestTitle != null)
                {
                    return(bestTitle.nameF);
                }
                if (title_land != null)
                {
                    return(title_land.titleF);
                }
                return("Lady");
            }
        }