Beispiel #1
0
        internal static ChallengeGenerals Parse(IniParser parser)
        {
            var result = new ChallengeGenerals();

            while (true)
            {
                parser.GoToNextLine();

                var token = parser.GetNextTokenOptional();
                if (token == null)
                {
                    continue;
                }
                else if (token.Value.Text.ToUpperInvariant() == IniParser.EndToken)
                {
                    break;
                }
                else
                {
                    var personaName = token.Value.Text;

                    result.Personas[personaName] = GeneralPersona.Parse(parser);
                }
            }

            return(result);
        }
Beispiel #2
0
        internal static ChallengeGenerals Parse(IniParser parser)
        {
            parser.NextToken();

            parser.NextToken(IniTokenType.EndOfLine);

            var result = new ChallengeGenerals();

            while (true)
            {
                if (parser.Current.TokenType == IniTokenType.Identifier && parser.Current.StringValue.ToUpper() == "END")
                {
                    parser.NextToken();
                    break;
                }
                else
                {
                    var personaName = parser.Current.StringValue;

                    parser.NextToken();

                    result.Personas[personaName] = GeneralPersona.Parse(parser);

                    parser.NextTokenIf(IniTokenType.EndOfLine);
                }
            }

            parser.NextTokenIf(IniTokenType.EndOfLine);

            return(result);
        }