Class AssetLoaderProvider

java.lang.Object
technology.sola.engine.assets.AssetLoaderProvider

@NullMarked public class AssetLoaderProvider extends Object
The AssetLoaderProvider class holds instances of AssetLoaders for various Asset types.
  • Constructor Details

    • AssetLoaderProvider

      public AssetLoaderProvider()
  • Method Details

    • add

      public void add(AssetLoader<?> assetLoader)
      Adds an AssetLoader that can be retrieved and used later.
      Parameters:
      assetLoader - the AssetLoader to add
    • get

      public <T extends Asset> AssetLoader<T> get(Class<T> assetClass)
      Retrieves an AssetLoader for the desired Asset type via the asset's class.
      Type Parameters:
      T - the type of Asset
      Parameters:
      assetClass - the class of asset to load
      Returns:
      the AssetLoader instance for the desired asset class
      Throws:
      MissingAssetLoaderException - if there is no asset loader added for desired asset