protected override void Save()
{
if (!this.infoLoaded)
return;
RGSSTable table = new RGSSTable(this.Size.Width, this.Size.Height, this.Layers.Count);
List<MapLayer> truth = new List<MapLayer>(this.Layers);
if (truth.Count == 4)
{
MapLayer layer = truth[2];
truth.Remove(layer);
truth.Add(layer);
}
for (int z = 0; z < truth.Count; z++)
{
for (int x = 0; x < this.Size.Width; x++)
{
for (int y = 0; y < this.Size.Height; y++)
{
table[x, y, z] = truth[z].Data[x, y];
}
}
}
raw.InstanceVariable["@data"] = table;
using (var fs = new System.IO.FileStream(this.filename, System.IO.FileMode.Create, System.IO.FileAccess.Write))
{
NekoKun.Serialization.RubyMarshal.RubyMarshal.Dump(fs, raw);
}
}