Exemple #1
0
 // Token: 0x06000152 RID: 338 RVA: 0x0000563C File Offset: 0x0000383C
 public void Save(Stream stream)
 {
     using (DeflateStream deflateStream = new DeflateStream(stream, CompressionMode.Compress, true))
     {
         SerializationContext serializationContext = new SerializationContext();
         MemoryStream         memoryStream         = new MemoryStream();
         VarLenBinaryWriter   varLenBinaryWriter   = new VarLenBinaryWriter(memoryStream);
         uint width  = this.Width;
         uint height = this.Height;
         int  num    = 0;
         while ((long)num < (long)((ulong)height))
         {
             int num2 = 0;
             while ((long)num2 < (long)((ulong)width))
             {
                 this.Tiles[num2, num].WriteTo(varLenBinaryWriter, serializationContext);
                 num2++;
             }
             num++;
         }
         varLenBinaryWriter = new VarLenBinaryWriter(deflateStream);
         varLenBinaryWriter.Write(1);
         varLenBinaryWriter.WriteVarLen32(this.Width);
         varLenBinaryWriter.WriteVarLen32(this.Height);
         serializationContext.WriteTo(varLenBinaryWriter);
         memoryStream.Position = 0L;
         memoryStream.CopyTo(deflateStream);
     }
 }
Exemple #2
0
 // Token: 0x06000148 RID: 328 RVA: 0x000054FC File Offset: 0x000036FC
 internal void WriteTo(VarLenBinaryWriter writer, SerializationContext ctx)
 {
     writer.WriteVarLen32(ctx.GetObjectKey(this.ObjectType));
     writer.WriteVarLen32((uint)this.Attributes.Length);
     KeyValuePair <string, string>[] attributes = this.Attributes;
     for (int i = 0; i < attributes.Length; i++)
     {
         KeyValuePair <string, string> keyValuePair = attributes[i];
         writer.Write(keyValuePair.Key);
         writer.Write(keyValuePair.Value);
     }
 }
Exemple #3
0
 // Token: 0x060001A7 RID: 423 RVA: 0x00006218 File Offset: 0x00004418
 internal void WriteTo(VarLenBinaryWriter writer, SerializationContext ctx)
 {
     writer.WriteVarLen32(ctx.GetTileKey(this.TileType));
     writer.WriteVarLen32((uint)this.Biome);
     writer.Write(this.Elevation);
     writer.Write(this.Moisture);
     writer.WriteVarLen32((uint)this.Objects.Length);
     MapObject[] objects = this.Objects;
     for (int i = 0; i < objects.Length; i++)
     {
         MapObject mapObject = objects[i];
         mapObject.WriteTo(writer, ctx);
     }
     writer.WriteVarLen32(ctx.GetRegionKey(this.Region));
 }
Exemple #4
0
 // Token: 0x06000099 RID: 153 RVA: 0x00003778 File Offset: 0x00001978
 public void WriteTo(VarLenBinaryWriter writer)
 {
     writer.WriteVarLen32((uint)this.TileIdMap.Count);
     foreach (KeyValuePair <uint, uint> current in this.TileIdMap)
     {
         writer.WriteVarLen32(current.Value);
         writer.WriteVarLen32(current.Key);
     }
     writer.WriteVarLen32((uint)this.ObjectIdMap.Count);
     foreach (KeyValuePair <uint, uint> current2 in this.ObjectIdMap)
     {
         writer.WriteVarLen32(current2.Value);
         writer.WriteVarLen32(current2.Key);
     }
     writer.WriteVarLen32((uint)this.RegionMap.Count);
     foreach (KeyValuePair <string, uint> current3 in this.RegionMap)
     {
         writer.WriteVarLen32(current3.Value);
         writer.Write(current3.Key);
     }
 }