private void Parse( string _Content ) { Parser P = new Parser( _Content ); List<Entity> Entities = new List<Entity>(); P.ConsumeString( "Version" ); int Version = P.ReadInteger(); if ( Version != 4 ) P.Error( "Unsupported file version!" ); while ( P.OK ) { P.ConsumeString( "entity" ); string Block = P.ReadBlock(); Entity E = new Entity( this ); if ( E.Parse( Block ) ) { Entities.Add( E ); } P.SkipSpaces(); } m_Entities.AddRange( Entities ); // Parse all refmaps foreach ( Entity E in Entities ) if ( E.m_Type == Entity.TYPE.REF_MAP ) { using ( StreamReader R = new FileInfo( E.m_RefMapName ).OpenText() ) { string Content = R.ReadToEnd(); Parse( Content ); } } }
private void Parse(string _Content) { Parser P = new Parser(_Content); List <Entity> Entities = new List <Entity>(); P.ConsumeString("Version"); int Version = P.ReadInteger(); if (Version != 4) { P.Error("Unsupported file version!"); } while (P.OK) { P.ConsumeString("entity"); string Block = P.ReadBlock(); Entity E = new Entity(this); if (E.Parse(Block)) { Entities.Add(E); } P.SkipSpaces(); } m_Entities.AddRange(Entities); // Parse all refmaps foreach (Entity E in Entities) { if (E.m_Type == Entity.TYPE.REF_MAP) { using (StreamReader R = new FileInfo(E.m_RefMapName).OpenText()) { string Content = R.ReadToEnd(); Parse(Content); } } } }