NekoKun.RPGMaker.MapFile.LoadInfo C# (CSharp) Method

LoadInfo() private method

private LoadInfo ( ) : void
return void
        private void LoadInfo()
        {
            RGSSTable data;
            infoLoaded = true;

            raw = NekoKun.Serialization.RubyMarshal.RubyMarshal.Load(new System.IO.FileStream(this.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read)) as RubyObject;
            this.TilesetID = (int)raw.InstanceVariable["@tileset_id"] - 1;
            var j = raw.InstanceVariable["@data"] as NekoKun.Serialization.RubyMarshal.RubyUserdefinedDumpObject;
            data = new RGSSTable(j.DumpedObject as byte[]);
            this.Size = new System.Drawing.Size((int)raw.InstanceVariable["@width"], (int)raw.InstanceVariable["@height"]);

            this.Layers = new List<MapLayer>();
            for (int z = 0; z < data.ZSize; z++)
            {
                MapLayer layer = new MapLayer();
                layer.Data = new short[this.Size.Width, this.Size.Height];
                for (int x = 0; x < this.Size.Width; x++)
                {
                    for (int y = 0; y < this.Size.Height; y++)
                    {
                        layer.Data[x, y] = data[x, y, z];
                    }
                }
                layer.Type = MapLayerType.Tile;

                this.Layers.Add(layer);
            }

            if (this.Layers.Count == 4)
            {
                MapLayer layer = this.Layers[3];
                this.Layers.Remove(layer);
                this.Layers.Insert(2, layer);

                layer.Type = MapLayerType.HalfBlockShadow;
            }

            raw.InstanceVariable["@data"] = null;
        }