Class M2Vanilla
A whole model for one client version: the MD20 body with skins and external sequence data baked in. A written model is canonical-layout and re-reads equal (no byte-perfect guarantee for offset formats). See https://wowdev.wiki/M2.
public class M2Vanilla : M2, IDisposable
- Inheritance
-
M2Vanilla
- Implements
- Inherited Members
Constructors
M2Vanilla()
public M2Vanilla()
M2Vanilla(M2Vanilla)
Copy-construct: a deep copy of other (the C++ copy constructor).
public M2Vanilla(M2Vanilla other)
Parameters
otherM2Vanilla
Properties
Root
The MD20 body — the model's root, uniform across every era (pre-Legion it IS the file; Legion+ it is the decoded MD21 image, whose transport blob chunks drops after read).
public M2RootVanilla Root { get; set; }
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(FileSystem, FileKey)
Load the model and all its satellite files from a client filesystem, replacing this entity's contents.
public void Read(FileSystem fs, FileKey key)
Parameters
fsFileSystemthe filesystem gateway
keyFileKeythe .m2 file identity (path and/or FileDataID)
Validate()
Check the logical integrity contracts this model must satisfy to LOAD in the client — across the body AND every skin — which write() deliberately never enforces. Call it before writing when you want to know the model will load. A model 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, each with its member path ("root..." / "skins[i]...")
Write(FileSystem, FileKey)
Serialize and store the model and every satellite file through the filesystem's project overlay; satellite names derive from the key, which must resolve to a path.
public void Write(FileSystem fs, FileKey key)
Parameters
fsFileSystemthe filesystem gateway
keyFileKeythe .m2 file identity; must resolve to a path