示例#1
0
 public void Setup()
 {
     using( var fs = File.OpenRead( "p2.sav" ) )
     {
         var s1 = new GameSection( fs );
         var s2 = new GameSection( fs );
         var s3 = new GameSection( fs );
         _buffer = new PcBuffer( new[] { s1, s2, s3 } );
     }
 }
示例#2
0
 void ExtractPcBuffer()
 {
     var buffer = new PcBuffer( _sections.Skip( 5 ).ToArray() );
     Boxes = new BindingList<Box>();
     PcBuffer = new BindingList<MonsterEntry>();
     PcBuffer.ListChanged += ( a, e ) => InvokePropertyChanged( "PcBuffer" );
     for( int i = 0; i < 420; i++ )
     {
         var entry = new MonsterEntry( buffer, 4 + ( 80 * i ), true );
         var boxnumber = (int) Math.Floor( i / 30.0 );
         if( i % 30 == 0 )
             Boxes.Add( new Box( boxnumber ) );
         PcBuffer.Add( entry );
         Boxes[boxnumber].Content.Add( entry );
     }
 }