Esempio n. 1
0
        public CharacterParser CreateNewCharacter(String culture, String religion, bool bFemale)
        {
            if (!bInit)
            {
                Init();
            }

            //   var scope = new ScriptScope();
            //  scope.Name = CharacterParser.IDMax.ToString();
            //  scope.SetChild(CharactersScript.Root);
            var chr = new CharacterParser();

            //   chr.SetProperty("dynasty", Rand.Next(1235)+1);
            //    chr.SetProperty("culture", new ScriptReference("norse"));
            //     chr.SetProperty("religion", new ScriptReference("pagan"));
            //  chr.DeleteProperty("name");
            Characters.Add(chr);
            chr.YearOfBirth = 769 - Rand.Next(60);
            chr.Dynasty     = DynastyManager.instance.GetDynasty(CultureManager.instance.CultureMap[culture]);
            chr.religion    = religion;
            chr.isFemale    = bFemale;
            chr.culture     = culture;
            chr.YearOfDeath = 769 + Rand.Next(30);
            this.CharactersScript.Root.SetChild(chr.Scope);
            AddedSinceLastPrune.Add(chr);
            CharacterMap[chr.ID] = chr;
            chr.SetupExistingDynasty();
            chr.UpdateCultural();
            return(chr);
        }