using System.Runtime.InteropServices;
namespace BurnOutSharp.Models.MoPaQ
{
///
/// The HET table is present if the HetTablePos64 member of MPQ header is
/// set to nonzero. This table can fully replace hash table. Depending on
/// MPQ size, the pair of HET&BET table can be more efficient than Hash&Block
/// table. HET table can be encrypted and compressed.
///
///
[StructLayout(LayoutKind.Sequential)]
public class HetTable
{
// TODO: Extract this out and make in common between HET and BET
#region Common Table Headers
///
/// 'HET\x1A'
///
public uint Signature;
///
/// Version. Seems to be always 1
///
public uint Version;
///
/// Size of the contained table
///
public uint DataSize;
#endregion
///
/// Size of the entire hash table, including the header (in bytes)
///
public uint TableSize;
///
/// Maximum number of files in the MPQ
///
public uint MaxFileCount;
///
/// Size of the hash table (in bytes)
///
public uint HashTableSize;
///
/// Effective size of the hash entry (in bits)
///
public uint HashEntrySize;
///
/// Total size of file index (in bits)
///
public uint TotalIndexSize;
///
/// Extra bits in the file index
///
public uint IndexSizeExtra;
///
/// Effective size of the file index (in bits)
///
public uint IndexSize;
///
/// Size of the block index subtable (in bytes)
///
public uint BlockTableSize;
///
/// HET hash table. Each entry is 8 bits.
///
/// Size is derived from HashTableSize
public byte[] HashTable;
///
/// Array of file indexes. Bit size of each entry is taken from dwTotalIndexSize.
/// Table size is taken from dwHashTableSize.
///
public byte[][] FileIndexes;
}
}