private void ParseContent( string _Content ) { Parser P = new Parser( _Content ); string property = P.ReadString(); while ( P.OK ) { switch ( property ) { case "spawnPosition": P.ConsumeString( "= " ); float3 Position = P.ReadFloat3( float3.Zero ); m_Local2World.r0.w = Position.x; m_Local2World.r1.w = Position.y; m_Local2World.r2.w = Position.z; break; case "spawnOrientation": P.ConsumeString( "= " ); string Orientation = P.ReadBlock(); ParseOrientation( Orientation ); break; case "renderModelInfo": P.ConsumeString( "= ! " ); string Model = P.ReadBlock(); ParseModel( Model ); break; case "m_probe": P.ConsumeString( "= " ); string ProbeName = P.UnQuote( P.ReadToEOL(), true ); break; case "mapname": P.ConsumeString( "= " ); m_RefMapName = RebaseFileName( P.UnQuote( P.ReadToEOL(), true ), "T:/", null ); break; case "m_usedForIBL": P.ReadToEOL(); m_IBL = true; break; // Don't care... (single line) case "entityPrefix": P.ReadToEOL(); break; // Don't care... (block) case "m_bounceFactorSun": case "m_kiscule": P.ConsumeString( "= " ); P.ReadBlock(); break; case "//": // Skip comment P.ReadToEOL(); break; default: P.Error( "Unexpected property!" ); break; } property = P.ReadString(); } }
private void ParseContent(string _Content) { Parser P = new Parser(_Content); string property = P.ReadString(); while (P.OK) { switch (property) { case "spawnPosition": P.ConsumeString("= "); float3 Position = P.ReadFloat3(float3.Zero); m_Local2World.r0.w = Position.x; m_Local2World.r1.w = Position.y; m_Local2World.r2.w = Position.z; break; case "spawnOrientation": P.ConsumeString("= "); string Orientation = P.ReadBlock(); ParseOrientation(Orientation); break; case "renderModelInfo": P.ConsumeString("= ! "); string Model = P.ReadBlock(); ParseModel(Model); break; case "m_probe": P.ConsumeString("= "); string ProbeName = P.UnQuote(P.ReadToEOL(), true); break; case "mapname": P.ConsumeString("= "); m_RefMapName = RebaseFileName(P.UnQuote(P.ReadToEOL(), true), "T:/", null); break; case "m_usedForIBL": P.ReadToEOL(); m_IBL = true; break; // Don't care... (single line) case "entityPrefix": P.ReadToEOL(); break; // Don't care... (block) case "m_bounceFactorSun": case "m_kiscule": P.ConsumeString("= "); P.ReadBlock(); break; case "//": // Skip comment P.ReadToEOL(); break; default: P.Error("Unexpected property!"); break; } property = P.ReadString(); } }