示例#1
0
文件: Trajets.cs 项目: karliky/wowwow
 public virtual void Deserialize( GenericReader gr )
 {
     int version = gr.ReadInt();
     int n = gr.ReadInt();
     for(int t = 0;t < n;t++)
     {
         Add( new Trajet( gr ) );
     }
     gr.Close();
     for(int t = 0;t < Trajet.allLinks.Count; )
     {
         Coord c = (Coord)Trajet.allLinks[ t++ ];
         int p1 = (int)Trajet.allLinks[ t++ ];
         int p2 = (int)Trajet.allLinks[ t++ ];
         int n1 = (int)Trajet.allLinks[ t++ ];
         int n2 = (int)Trajet.allLinks[ t++ ];
         c.previous = this[ p1 ][ p2 ];
         c.next = this[ n1 ][ n2 ];
         if ( c is Intersection )
         {
             Intersection ii = (Intersection)c;
             p1 = (int)Trajet.allLinks[ t++ ];
             p2 = (int)Trajet.allLinks[ t++ ];
             n1 = (int)Trajet.allLinks[ t++ ];
             n2 = (int)Trajet.allLinks[ t++ ];
             ii.left = this[ p1 ][ p2 ];
             ii.right = this[ n1 ][ n2 ];
         }
     }
     Trajet.allLinks.Clear();
     GC.Collect();
 }
示例#2
0
 public void Deserialize( GenericReader gr )
 {
     List.Clear();
     if ( !gr.notFound )
     {
         int version = gr.ReadInt();
         int n = gr.ReadInt();
         for(int t = 0;t < n;t++ )
         {
             Add( new Account( gr ) );
         }
     }
     if ( Count == 0 )
     {
         Account admin = new Account( "admin", "changeme", AccessLevels.Admin );
         Add( admin );
     }
     if ( !gr.notFound )
         gr.Close();
 }
示例#3
0
        public virtual void Deserialize( GenericReader gr )
        {
            TempSpawner[ 0 ] = null;
            int version = gr.ReadInt();

            while( true )
            {
                int n = gr.ReadInt();
                if ( n == 0 )
                    break;
                Add( new GameObject( gr ) );
            }
            gr.Close();
            TempSpawner.Clear();
            TempSpawner = null;
        }
示例#4
0
        public virtual void Deserialize( GenericReader gr )
        {
            TempSpawner[ 0 ] = null;
            int version = gr.ReadInt();

            while( true )
            {
                int n = gr.ReadInt();
                if ( n == 0 )
                    break;
                int type = gr.ReadInt();
                if ( type == 0 )
                    Add( new MobileSpawner( gr ) );
                else
                    Add( new GameObjectSpawner( gr ) );

            }
            int n1 = gr.ReadInt();
            for(int t = 0;t < n1;t++ )
            {
                int id = gr.ReadInt();
                int n2 = gr.ReadInt();
                ArrayList al = new ArrayList( n2 );
                World.regSpawners[ id ] = al;
                for(int i = 0;i < n2;i++ )
                {
                    al.Add( gr.ReadInt() );
                }
            }
            gr.Close();
            TempSpawner.Clear();
            TempSpawner = null;
        }