wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::formats::wdt::detail::WDT< V > Struct Template Reference

A whole WDT (map description) for one client version: the main file and its era's satellite files unified as one entity. More...

#include <wowlib/formats/wdt/wdt.hpp>

Inheritance diagram for wowlib::formats::wdt::detail::WDT< V >:

Public Member Functions

Result< void > read (fs::FileSystem &fs, const FileKey &key)
 Load the WDT and every satellite file present from a client filesystem, replacing this entity's contents.
Result< void > write (fs::FileSystem &fs, const FileKey &key) const
 Serialize and store the WDT (main file and every engaged satellite) through the filesystem's project overlay; satellite file names are derived from the main key, which must resolve to a path.
ValidationReport validate () const
Result< void > ensureValid () const
 Validate and raise on the first error instead of returning a report — the assert-style face of validate().

Public Attributes

WDTRoot< V > root {}
 The main file contents.

Static Public Attributes

static constexpr ClientVersion Version = V

Detailed Description

template<ClientVersion V>
struct wowlib::formats::wdt::detail::WDT< V >

A whole WDT (map description) for one client version: the main file and its era's satellite files unified as one entity.

Instantiate through the canonicalizing wdt::WDT alias, never directly.

The main file (WDTRoot) says which terrain tiles exist or which global WMO an object-only map shows; the satellites carry the map-wide occlusion heightmaps, placed lights, volumetric fogs and particulate volumes of the eras that have them. Satellites locate by the "{map}_occ.wdt" naming convention up to 8.1 and by the MPHD FileDataIDs after; a missing satellite stays default-empty and is not written back.

Template Parameters
Vthe client version this assembly targets.
See also
https://wowdev.wiki/WDT

Definition at line 98 of file wdt.hpp.

Member Function Documentation

◆ ensureValid()

template<ClientVersion V>
Result< void > wowlib::formats::wdt::detail::WDT< V >::ensureValid ( ) const
nodiscard

Validate and raise on the first error instead of returning a report — the assert-style face of validate().

Returns
nothing; raises when validate() finds any error

Definition at line 248 of file wdt.hpp.

References validate().

◆ read()

template<ClientVersion V>
Result< void > wowlib::formats::wdt::detail::WDT< V >::read ( fs::FileSystem & fs,
const FileKey & key )

Load the WDT and every satellite file present from a client filesystem, replacing this entity's contents.

Parameters
fsthe filesystem gateway
keythe main file identity (path and/or FileDataID)

Definition at line 163 of file wdt.hpp.

References wowlib::FormatVersionMismatch, wowlib::makeError(), wowlib::FileKey::path, wowlib::PathNotResolvable, root, and wowlib::formats::wdt::WdtVersion18.

◆ validate()

Definition at line 226 of file wdt.hpp.

References root, and wowlib::formats::detail::validateEntity().

Referenced by ensureValid().

◆ write()

template<ClientVersion V>
Result< void > wowlib::formats::wdt::detail::WDT< V >::write ( fs::FileSystem & fs,
const FileKey & key ) const

Serialize and store the WDT (main file and every engaged satellite) through the filesystem's project overlay; satellite file names are derived from the main key, which must resolve to a path.

Parameters
fsthe filesystem gateway
keythe main file identity; must resolve to a path

Definition at line 253 of file wdt.hpp.

References wowlib::formats::detail::entityEngaged(), wowlib::makeError(), wowlib::FileKey::path, wowlib::PathNotResolvable, and root.

Member Data Documentation

◆ root

The main file contents.

Definition at line 106 of file wdt.hpp.

Referenced by read(), validate(), and write().

◆ Version

template<ClientVersion V>
ClientVersion wowlib::formats::wdt::detail::WDT< V >::Version = V
staticconstexpr

Definition at line 103 of file wdt.hpp.


The documentation for this struct was generated from the following file: