Class WDTRoot
A WDT main file, abstract over the client version. The main file says which map tiles exist (and, since 8.1, which FileDataIDs serve them), or references the one global WMO of an object-only map. Construct a concrete version with WDTRoot.for_version(expansion); the per-version WDTRoot* classes are subclasses. See https://wowdev.wiki/WDT.
public class WDTRoot : IDisposable
- Inheritance
-
WDTRoot
- Implements
- Derived
- Inherited Members
Constructors
WDTRoot()
public WDTRoot()
WDTRoot(WDTRoot)
Copy-construct: a deep copy of other (the C++ copy constructor).
public WDTRoot(WDTRoot other)
Parameters
otherWDTRoot
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 WDTHeader Header { get; set; }
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 virtual void Dispose()
EnsureValid()
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
public void EnsureValid()
ForVersion(ClientVersion)
A fresh WDTRoot for an exact client version — the only axis that can name a Classic client, whose files follow the engine its build was cut on rather than its 1.15 / 4.4 version number.
public static WDTRoot ForVersion(ClientVersion version)
Parameters
versionClientVersion
Returns
ForVersion(Expansion)
A fresh WDTRoot for the given era, as the family base — the dynamic twin of the typed Era factories.
public static WDTRoot ForVersion(Expansion era)
Parameters
eraExpansion
Returns
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[]
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
Write()
Serialize this entity.
public byte[] Write()
Returns
- byte[]