ace/Source/ACE.DatLoader/DatDirectoryHeader.cs
gmriggs 7ab6311ac6
Some DatLoader updates (#1110)
* Some DatLoader updates

* commenting filetype

* Adding 0xE filetypes
2018-12-02 12:49:52 -05:00

29 lines
830 B
C#

using System.IO;
namespace ACE.DatLoader
{
public class DatDirectoryHeader : IUnpackable
{
internal static readonly uint ObjectSize = ((sizeof(uint) * 0x3E) + sizeof(uint) + (DatFile.ObjectSize * 0x3D));
public uint[] Branches { get; } = new uint[0x3E];
public uint EntryCount { get; private set; }
public DatFile[] Entries { get; private set; }
public void Unpack(BinaryReader reader)
{
for (int i = 0; i < Branches.Length; i++)
Branches[i] = reader.ReadUInt32();
EntryCount = reader.ReadUInt32();
Entries = new DatFile[EntryCount];
for (int i = 0; i < EntryCount; i++)
{
Entries[i] = new DatFile();
Entries[i].Unpack(reader);
}
}
}
}