SkipSpaces() public method

public SkipSpaces ( ) : bool
return bool
示例#1
0
文件: Map.cs 项目: Patapom/GodComplex
        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 );
                    }
                }
        }
示例#2
0
文件: Map.cs 项目: vr3d/GodComplex
        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);
                    }
                }
            }
        }