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); }
internal static Payload Parse(IniParser parser) { return(new Payload { Name = parser.ParseAssetReference(), Quantity = (int)(parser.NextTokenIf(IniTokenType.IntegerLiteral)?.IntegerValue ?? 1) }); }
internal static LodPreset Parse(IniParser parser) { parser.NextToken(IniTokenType.Identifier); parser.NextToken(IniTokenType.Equals); var result = new LodPreset { Level = parser.ParseEnum <StaticGameLodLevel>(), CpuType = parser.ParseEnum <CpuType>(), MHz = parser.ParseInteger(), GpuType = parser.ParseEnum <GpuType>(), GpuMemory = parser.ParseInteger() }; parser.NextTokenIf(IniTokenType.EndOfLine); return(result); }