示例#1
0
        private static void ParseLaws(ParadoxParser parser, List <Law> lawRules)
        {
            Law l = new Law("");

            Action <ParadoxParser, string> lawGroup = (p, s) =>
            {
                l = new Law(s);

                Action <ParadoxParser, string> lawOptions = (p2, s2) =>
                {
                    switch (s2)
                    {
                    case "banned_religion_group":
                    case "banned_religion":
                        l.BannedReligions.Add(p2.ReadString());
                        break;

                    case "allowed_religion_group":
                    case "allowed_religion":
                        l.AllowedReligions.Add(p2.ReadString());
                        break;

                    case "banned_culture_group":
                    case "banned_culture":
                        l.BannedCultures.Add(p2.ReadString());
                        break;

                    case "allowed_culture_group":
                    case "allowed_culture":
                        l.AllowedCultures.Add(p2.ReadString());
                        break;
                    }
                };

                p.Parse(lawOptions);

                lawRules.Add(l);
            };

            parser.Parse(lawGroup);
        }
示例#2
0
		private static void ParseLaws( ParadoxParser parser, List<Law> lawRules )
		{
			Law l = new Law( "" );

			Action<ParadoxParser, string> lawGroup = ( p, s ) =>
													   {
														   l = new Law( s );

														   Action<ParadoxParser, string> lawOptions = ( p2, s2 ) =>
														   {
															   switch( s2 )
															   {
																   case "banned_religion_group":
																   case "banned_religion":
																	   l.BannedReligions.Add( p2.ReadString() );
																	   break;
																   case "allowed_religion_group":
																   case "allowed_religion":
																	   l.AllowedReligions.Add( p2.ReadString() );
																	   break;

																   case "banned_culture_group":
																   case "banned_culture":
																	   l.BannedCultures.Add( p2.ReadString() );
																	   break;
																   case "allowed_culture_group":
																   case "allowed_culture":
																	   l.AllowedCultures.Add( p2.ReadString() );
																	   break;
															   }
														   };

														   p.Parse( lawOptions );

														   lawRules.Add( l );
													   };

			parser.Parse( lawGroup );
		}