/// <summary>
/// Returns the tiles of this Tileset (empty 0th tile excluded) written sequentially in a byte array
/// </summary>
public byte[] ToBytes(bool compressed)
{
byte[] result = new byte[Count * GBA.Tile.LENGTH];
int index = 0;
for (int i = 0; i < Count; i++)
{
Array.Copy(Sheet[i].Bytes, 0, result, index, Sheet[i].Bytes.Length);
index += Sheet[i].Bytes.Length;
}
return(compressed ? LZ77.Compress(result) : result);
}