Table of Contents

Class ADT

Namespace
WoWLib.Formats.ADT
Assembly
WoWLib.dll

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

other ADT

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

AlphaFormat

Chunks

The 256 terrain chunks (MCNK), row-major (index = y * 16 + x).

public FamilyVector<MapChunk> Chunks { get; }

Property Value

FamilyVector<MapChunk>

DoodadPlacements

Doodad (M2) placements on this tile (MDDF).

public Vector<SmDoodadDef> DoodadPlacements { get; }

Property Value

Vector<SmDoodadDef>

Header

The tile header (MHDR): flags; the chunk offsets are derived.

public MHDRData Header { get; set; }

Property Value

MHDRData

ModelFilenames

The M2 model filenames (MMDX) placements reference by MMID index.

public StringBlock ModelFilenames { get; }

Property Value

StringBlock

ModelNameOffsets

Byte offsets into model_filenames (MMID): a doodad placement's name_id indexes this list.

public Vector<uint> ModelNameOffsets { get; }

Property Value

Vector<uint>

Mver

The ADT format version (MVER); 18 for every supported client.

public uint Mver { get; set; }

Property Value

uint

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

StringBlock

WmoFilenames

The WMO filenames (MWMO) placements reference by MWID index.

public StringBlock WmoFilenames { get; }

Property Value

StringBlock

WmoNameOffsets

Byte offsets into wmo_filenames (MWID): a WMO placement's name_id indexes this list.

public Vector<uint> WmoNameOffsets { get; }

Property Value

Vector<uint>

WmoPlacements

WMO placements on this tile (MODF).

public Vector<SmMapObjDef> WmoPlacements { get; }

Property Value

Vector<SmMapObjDef>

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

version ClientVersion

Returns

ADT

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

era Expansion

Returns

ADT

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

fs FileSystem
key FileKey
alpha AlphaFormat

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

ValidationReport

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

fs FileSystem
key FileKey
alpha AlphaFormat