API reference
Class AssetLoaderRegistry
Namespace: MicroEngine.Content
Assembly: MicroEngine.Content.dll
Guide: Assets
The loaders of a store, one per kind. The engine registers its own (images, atlases, fonts, sounds, music); a game or module adds kinds of its own, or replaces one by registering another loader with the same kind before the first load of that kind.
public sealed class AssetLoaderRegistryInheritance
Constructors
AssetLoaderRegistry()
public AssetLoaderRegistry()Properties
Kinds
The kinds registered, in ordinal order.
public IReadOnlyList<string> Kinds { get; }Property Value
Methods
Add(IAssetLoader)
Registers loader, replacing any loader of the same kind.
public AssetLoaderRegistry Add(IAssetLoader loader)Parameters
loader IAssetLoader
Returns
This registry, for chaining.
Get(string)
The loader of kind.
public IAssetLoader Get(string kind)Parameters
kind string
Returns
Exceptions
No loader of that kind is registered; the message lists those that are.
KindOf(string)
The kind of the loader whose Extensions holds path’s extension (the first registered), or null.
public string? KindOf(string path)Parameters
path string
Returns
TryGet(string, out IAssetLoader?)
The loader of kind, if one is registered.
public bool TryGet(string kind, out IAssetLoader? loader)Parameters
kind string
loader IAssetLoader?