Esempio n. 1
0
        private static CharacterRule ParseCharacter(ParadoxParser parser)
        {
            CharacterRule cr = new CharacterRule();

            Action <ParadoxParser, string> getOptions = (p, s) =>
            {
                switch (s)
                {
                case "gender":
                    cr.IsFemale = p.ReadString() == "female";
                    break;

                case "religion":
                    cr.Religion = p.ReadString();
                    break;

                case "culture":
                    cr.Culture = p.ReadString();
                    break;

                case "id":
                    cr.ID = p.ReadInt32();
                    break;

                case "dynasty":
                    cr.Dynasty = p.ReadInt32();
                    break;

                case "write_character":
                    cr.WriteCharacter = p.ReadBool();
                    break;

                case "title":
                    cr.Titles.Add(p.ReadString());
                    break;
                }
            };

            parser.Parse(getOptions);

            return(cr);
        }
Esempio n. 2
0
		private static CharacterRule ParseCharacter( ParadoxParser parser )
		{
			CharacterRule cr = new CharacterRule();

			Action<ParadoxParser, string> getOptions = ( p, s ) =>
													   {
														   switch( s )
														   {
															   case "gender":
																   cr.IsFemale = p.ReadString() == "female";
																   break;
															   case "religion":
																   cr.Religion = p.ReadString();
																   break;
															   case "culture":
																   cr.Culture = p.ReadString();
																   break;
															   case "id":
																   cr.ID = p.ReadInt32();
																   break;
															   case "dynasty":
																   cr.Dynasty = p.ReadInt32();
																   break;
															   case "write_character":
																   cr.WriteCharacter = p.ReadBool();
																   break;
															   case "title":
																   cr.Titles.Add( p.ReadString() );
																   break;
														   }
													   };

			parser.Parse( getOptions );

			return cr;
		}