public LuaModule(AssetManager manager, BinaryReader reader, string name)
: base(manager, name)
{
using (reader) {
reader.RequireMagic(Magic);
VersionCode = reader.ReadByte();
Endianness = reader.ReadByte() != 0 ? ByteOrder.LittleEndian : ByteOrder.BigEndian;
IntSize = reader.ReadByte();
SizeTSize = reader.ReadByte();
InstructionSize = reader.ReadByte();
InstructionOpSize = reader.ReadByte();
InstructionASize = reader.ReadByte();
InstructionBSize = reader.ReadByte();
InstructionCSize = reader.ReadByte();
NumberSize = reader.ReadByte();
if (IntSize != 4 || SizeTSize != 4 || InstructionSize != 4 || InstructionOpSize != 6 || InstructionASize != 8 || InstructionBSize != 9 || InstructionCSize != 9 || NumberSize != 8)
throw new InvalidDataException();
double constant = ReadNumber(reader);
if (constant != 3.14159265358979323846e7)
throw new InvalidDataException();
Main = new LuaFunction(reader, this);
}
}