2018-02-06 10:18:38 -06:00
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace ACE.DatLoader
|
|
|
|
|
{
|
|
|
|
|
public class DatDirectoryHeader : IUnpackable
|
|
|
|
|
{
|
2024-08-24 07:32:35 -07:00
|
|
|
internal const uint ObjectSize = ((sizeof(uint) * 0x3E) + sizeof(uint) + (DatFile.ObjectSize * 0x3D));
|
2018-02-06 10:18:38 -06:00
|
|
|
|
|
|
|
|
public uint[] Branches { get; } = new uint[0x3E];
|
|
|
|
|
public uint EntryCount { get; private set; }
|
2018-12-02 12:49:52 -05:00
|
|
|
public DatFile[] Entries { get; private set; }
|
2018-02-06 10:18:38 -06:00
|
|
|
|
|
|
|
|
public void Unpack(BinaryReader reader)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < Branches.Length; i++)
|
|
|
|
|
Branches[i] = reader.ReadUInt32();
|
|
|
|
|
|
|
|
|
|
EntryCount = reader.ReadUInt32();
|
|
|
|
|
|
2018-12-02 12:49:52 -05:00
|
|
|
Entries = new DatFile[EntryCount];
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < EntryCount; i++)
|
2018-02-06 10:18:38 -06:00
|
|
|
{
|
|
|
|
|
Entries[i] = new DatFile();
|
|
|
|
|
Entries[i].Unpack(reader);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|