API reference
Struct AssetKey
Namespace: MicroEngine.Content
Assembly: MicroEngine.Content.dll
Guide: Assets
What identifies a stored asset: the loader’s kind, the content path and the settings it was loaded with. Two requests with equal keys share one object. A struct of references and values, so a lookup allocates nothing.
public readonly struct AssetKey : IEquatable<AssetKey>Implements
Constructors
AssetKey(string, string, object?, long)
What identifies a stored asset: the loader’s kind, the content path and the settings it was loaded with. Two requests with equal keys share one object. A struct of references and values, so a lookup allocates nothing.
public AssetKey(string Kind, string Path, object? Options = null, long Variant = 0)Parameters
Kind string
The kind of the loader that makes it (“texture”, “sound”…; see AssetLoaderRegistry).
Path string
The path in the content source, ‘/’-separated (normalized by the store, see Normalize).
Options object?
Load settings compared by value (a record), or null for the loader’s defaults.
Variant long
A small value that also tells loads apart (a sampling filter, for example) without boxing it.
Properties
Kind
The kind of the loader that makes it (“texture”, “sound”…; see AssetLoaderRegistry).
public string Kind { get; init; }Property Value
Options
Load settings compared by value (a record), or null for the loader’s defaults.
public object? Options { get; init; }Property Value
Path
The path in the content source, ‘/’-separated (normalized by the store, see Normalize).
public string Path { get; init; }Property Value
Variant
A small value that also tells loads apart (a sampling filter, for example) without boxing it.
public long Variant { get; init; }Property Value
Methods
Deconstruct(out string, out string, out object?, out long)
public void Deconstruct(out string Kind, out string Path, out object? Options, out long Variant)Parameters
Kind string
Path string
Options object?
Variant long
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(AssetKey)
public bool Equals(AssetKey other)Parameters
other AssetKey
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
“kind ‘path’” for messages.
public override string ToString()Returns
Operators
operator ==(AssetKey, AssetKey)
public static bool operator ==(AssetKey left, AssetKey right)Parameters
left AssetKey
right AssetKey
Returns
operator !=(AssetKey, AssetKey)
public static bool operator !=(AssetKey left, AssetKey right)Parameters
left AssetKey
right AssetKey