Table of Contents

Class Skin

Namespace
WoWLib.Formats.M2.Skin
Assembly
WoWLib.dll

An external model LOD view (.skin file), abstract over the client version. Construct a concrete version with Skin.for_version(expansion); the per-version Skin* classes are subclasses. See https://wowdev.wiki/M2/.skin.

public class Skin : IDisposable
Inheritance
Skin
Implements
Derived
Inherited Members

Constructors

Skin()

public Skin()

Skin(Skin)

Copy-construct: a deep copy of other (the C++ copy constructor).

public Skin(Skin other)

Parameters

other Skin

Properties

Profile

The LOD view's tables (local lookups, submeshes, batches).

public M2SkinProfile Profile { get; set; }

Property Value

M2SkinProfile

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()

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

ForVersion(ClientVersion)

A fresh Skin 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 Skin ForVersion(ClientVersion version)

Parameters

version ClientVersion

Returns

Skin

ForVersion(Expansion)

A fresh Skin for the given era, as the family base — the dynamic twin of the typed Era factories.

public static Skin ForVersion(Expansion era)

Parameters

era Expansion

Returns

Skin

GetHashCode()

Reference-identity hash (the C++ type has no hash to mirror).

public override int GetHashCode()

Returns

int

Read(byte[])

Deserialize file bytes into this entity, replacing its contents. Offsets resolve against the given buffer; sequence-gated data is read inline.

public void Read(byte[] data)

Parameters

data byte[]

Validate()

Check the logical integrity contracts this file must satisfy to LOAD in the client — companion-array counts, lookup ranges — 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

ValidationReport

Write()

Serialize this entity in wowlib's canonical layout (an offset format has no byte-perfect round-trip guarantee; a written entity re-reads equal instead).

public byte[] Write()

Returns

byte[]

Operators

operator ==(Skin?, Skin?)

public static bool operator ==(Skin? l, Skin? r)

Parameters

l Skin
r Skin

Returns

bool

operator !=(Skin?, Skin?)

public static bool operator !=(Skin? l, Skin? r)

Parameters

l Skin
r Skin

Returns

bool