Class ADT
A terrain map tile, abstract over the client version — the .adt file (and, since Cataclysm, its _tex0/_obj0/_obj1/_lod split files) as one entity. Construct the concrete version with ADT.for_version(expansion), then read()/write(); the per-version ADT* classes are subclasses. See https://wowdev.wiki/ADT/v18.
public class ADT : FileEntity, IDisposable
- Inheritance
-
ADT
- Implements
- Derived
- Inherited Members
Constructors
ADT()
public ADT()
ADT(ADT)
Copy-construct: a deep copy of other (the C++ copy constructor).
public ADT(ADT other)
Parameters
otherADT
Properties
AlphaFormat
How this tile's alpha maps were laid out on disk, recorded from the AlphaFormat passed to read(); write() takes its own explicit argument. wowlib always presents decoded 64x64 maps.
public AlphaFormat AlphaFormat { get; set; }
Property Value
Chunks
The 256 terrain chunks (MCNK), row-major (index = y * 16 + x).
public FamilyVector<MapChunk> Chunks { get; }
Property Value
DoodadPlacements
Doodad (M2) placements on this tile (MDDF).
public Vector<SmDoodadDef> DoodadPlacements { get; }
Property Value
Header
The tile header (MHDR): flags; the chunk offsets are derived.
public MHDRData Header { get; set; }
Property Value
ModelFilenames
The M2 model filenames (MMDX) placements reference by MMID index.
public StringBlock ModelFilenames { get; }
Property Value
ModelNameOffsets
Byte offsets into model_filenames (MMID): a doodad placement's name_id indexes this list.
public Vector<uint> ModelNameOffsets { get; }
Property Value
Mver
The ADT format version (MVER); 18 for every supported client.
public uint Mver { get; set; }
Property Value
Textures
The tileset texture filenames (MTEX): the paths MapChunk layers index. Present unless the tile uses MDID/MHID FileDataIDs (8.1+ height-texturing maps).
public StringBlock Textures { get; }
Property Value
WmoFilenames
The WMO filenames (MWMO) placements reference by MWID index.
public StringBlock WmoFilenames { get; }
Property Value
WmoNameOffsets
Byte offsets into wmo_filenames (MWID): a WMO placement's name_id indexes this list.
public Vector<uint> WmoNameOffsets { get; }
Property Value
WmoPlacements
WMO placements on this tile (MODF).
public Vector<SmMapObjDef> WmoPlacements { 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()
ForVersion(ClientVersion)
A fresh ADT 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 ADT ForVersion(ClientVersion version)
Parameters
versionClientVersion
Returns
ForVersion(Expansion)
A fresh ADT for the given era, as the family base — the dynamic twin of the typed Era factories.
public static ADT ForVersion(Expansion era)
Parameters
eraExpansion
Returns
Read(FileSystem, FileKey, AlphaFormat)
Load the tile — every split file present — from a client filesystem, replacing this entity's contents. The alpha-map bit depth (from the map's WDT) is supplied by the caller.
public void Read(FileSystem fs, FileKey key, AlphaFormat alpha)
Parameters
fsFileSystemkeyFileKeyalphaAlphaFormat
Validate()
Check the logical integrity contracts this tile must satisfy to LOAD in the client — across every terrain chunk AND the tile-wide tables — which write() deliberately never enforces. Call it before writing when you want to know the tile will load. A tile read from a client and left unmodified reports no errors; warnings mark states real client files ship.
public ValidationReport Validate()
Returns
Write(FileSystem, FileKey, AlphaFormat)
Serialize the tile (and, Cata+, every split file) through the filesystem's project overlay; the file names derive from the key, which must resolve to a path. The alpha-map bit depth to encode is supplied by the caller.
public void Write(FileSystem fs, FileKey key, AlphaFormat alpha)
Parameters
fsFileSystemkeyFileKeyalphaAlphaFormat