Bricklayer.Common.Networking.Messages.InitMessage.Decode C# (CSharp) Метод

Decode() публичный Метод

public Decode ( NetIncomingMessage im ) : void
im Lidgren.Network.NetIncomingMessage
Результат void
        public void Decode(NetIncomingMessage im)
        {
            map.Width = Width = im.ReadInt16();
            map.Height = Height= im.ReadInt16();
            map.Tiles = new Tile[map.Width, map.Height, 2];

            for (int z = 0; z < 2; z++)
            {
                for (int y = 0; y < map.Height; y++)
                {
                    for (int x = 0; x < map.Width; x++)
                    {
                        if (z == 0)
                            map.Tiles[x, y, 1] = new Tile(BlockType.FromID(im.ReadByte()));
                        else
                            map.Tiles[x, y, 0] = new Tile(BlockType.FromID(im.ReadByte()));
                    }
                }
            }
        }