anchor.diff:  uses
     typinfo;
   
  +const
  +
  +  TILES_FIELD = 'tiles';
  +  TEMPLATES_FIELD = 'templates';
  +  OBJECTS_FIELD = 'objects';
  +
   
   { TMapWriterVCMI }
   
  
positive.code: 
      d := FStreamer.StreamCollection(AMap.Templates);
  
      map_o.Add('templates', d);
  
      d := FStreamer.StreamCollection(AMap.Objects);
      map_o.Add('objects',d);
  
      StreamTiles(map_o, AMap);
  
  
negative.code: 
    map_o := FDestreamer.JSONStreamToJson(AStream) as TJSONObject;
  
    cp.Levels := map_o.Integers['levels'];
    cp.Height := map_o.Integers['height'];
    cp.Width  := map_o.Integers['width'];
  
    Result := TVCMIMap.CreateExisting(FMapEnv, cp);
    try
      try
        DeStreamTiles(map_o,Result);
  
        FDestreamer.JSONToObject(map_o, Result);
  
        FDestreamer.JSONToCollection(map_o.Elements[TEMPLATES_FIELD],Result.Templates);
        FDestreamer.JSONToCollection(map_o.Elements[OBJECTS_FIELD],Result.Objects);
  
      finally
        map_o.Free;
  