using System.IO;
namespace BOTWToolset.IO.EXTM
{
///
/// Interacts with grass data in an .extm file, used in conjunction with .
/// More info found on the ZeldaMods wiki.
///
class Grass
{
public byte Height { get => _height; set => _height = value; }
private byte _height;
public byte R { get => _r; set => _r = value; }
private byte _r;
public byte G { get => _g; set => _g = value; }
private byte _g;
public byte B { get => _b; set => _b = value; }
private byte _b;
///
/// Gets an array of from an array of bytes.
///
/// The array of bytes to retrieve data from.
/// [] data.
public static Grass[] FromBytes(byte[] bytes)
{
using (var r = new BinaryReaderBig(new MemoryStream(bytes)))
{
Grass[] grasses = new Grass[r.BaseStream.Length / 4];
for (int i = 0; i < grasses.Length; i++)
{
Grass g = new Grass
{
Height = r.ReadByte(),
R = r.ReadByte(),
G = r.ReadByte(),
B = r.ReadByte()
};
grasses[i] = g;
}
return grasses;
}
}
}
}