Esempio n. 1
0
    void IByteable.Read(ByteScribe reader)
    {
        reader.ReadByte();//fileVersion
        width  = reader.ReadByte();
        height = reader.ReadByte();

        exitNorth = reader.ReadString();
        exitSouth = reader.ReadString();
        exitEast  = reader.ReadString();
        exitWest  = reader.ReadString();

        if (arrayLength != width * height)
        {
            arrayLength = width * height;
            for (int i = 0; i < layerCount; i++)
            {
                tileData[i] = new byte[arrayLength];
            }
        }

        for (int l = 0; l < layerCount; l++)
        {
            for (int i = 0; i < arrayLength; i++)
            {
                tileData[l][i] = reader.ReadByte();
            }
        }

        decorations.Clear();
        int decCount = reader.ReadByte();

        for (int i = 0; i < decCount; i++)
        {
            AddDecoration(reader.ReadFloat(), reader.ReadFloat(), reader.ReadByte());
        }
    }
Esempio n. 2
0
 void IByteable.Read(ByteScribe reader)
 {
     x     = reader.ReadFloat();
     y     = reader.ReadFloat();
     value = reader.ReadByte();
 }