Class WDTRootBfa
A WDT main file for one client version: the map header, the 64x64 tile table (row-major, y outer), the per-tile FileDataIDs (8.1+) and the global WMO of object-only maps. An instance read from a client file rewrites byte-for-byte until modified. See https://wowdev.wiki/WDT.
public class WDTRootBfa : WDTRoot, IDisposable
- Inheritance
-
WDTRootBfa
- Implements
- Inherited Members
Constructors
WDTRootBfa()
public WDTRootBfa()
WDTRootBfa(WDTRootBfa)
Copy-construct: a deep copy of other (the C++ copy constructor).
public WDTRootBfa(WDTRootBfa other)
Parameters
otherWDTRootBfa
Properties
GlobalWmo
The global-WMO placement (MODF) of a WMO-only map; at most one record. Its name_id is unused — the client always loads the MWMO content (or, in FileDataID-era files without MWMO, treats name_id as the WMO FileDataID).
public Vector<SmMapObjDef> GlobalWmo { get; }
Property Value
GlobalWmoName
The global-WMO filename (MWMO) of a WMO-only map, as a string block holding the one zero-terminated path (at most 0x100 bytes). Terrain maps of pre-8.1 clients still carry the chunk empty; FileDataID-era terrain maps drop it.
public StringBlock GlobalWmoName { get; set; }
Property Value
Header
The map header (MPHD): flags and, since 8.1, the satellite FileDataIDs.
public WDTHeaderBfaPlus Header { get; set; }
Property Value
MapFdids
Per-tile FileDataIDs (MAID, 8.1.0.28294+): 64 x 64 records in row-major order (y outer, x inner), one per map tile — engaged by the has_maid header flag. WMO-only maps omit it.
public Vector<MapFileDataIDs> MapFdids { get; }
Property Value
Mver
The WDT format version; 18 for every supported client.
public uint Mver { get; set; }
Property Value
Tiles
The tile table (MAIN): 64 x 64 records in row-major order (y outer, x inner), flagging which tiles have an ADT.
public Vector<SmAreaInfo> Tiles { get; }
Property Value
Methods
Dispose()
Release the native object now. Optional: the finalizer releases it on
collection anyway - dispose (or using) when you want native memory back
promptly.
public override void Dispose()
EnsureValid()
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
public void EnsureValid()
Read(byte[])
Deserialize file bytes into this entity, replacing its contents. Unmodeled chunks are preserved so an unmodified entity rewrites byte-for-byte.
public void Read(byte[] data)
Parameters
databyte[]the file bytes
Validate()
Check the logical integrity contracts this file must satisfy to LOAD in the client — companion-chunk counts, index ranges, flag/presence coherence — which write() deliberately never enforces. Call it before writing when you want to know the result will load. A file read from a client and left unmodified reports no errors; warnings mark states real client files ship.
public ValidationReport Validate()
Returns
- ValidationReport
every violated contract, in member order
Write()
Serialize this entity.
public byte[] Write()
Returns
- byte[]
the file bytes