java.lang.Object
technology.sola.engine.assets.AssetLoaderProvider
The AssetLoaderProvider class holds instances of
AssetLoaders for various Asset types.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(AssetLoader<?> assetLoader) Adds anAssetLoaderthat can be retrieved and used later.<T extends Asset>
AssetLoader<T>Retrieves anAssetLoaderfor the desiredAssettype via the asset's class.voidloadAssetsFromAssetList(Consumer<AssetList> onComplete) Loads assets from the mainAssetListasset (located atAssetList.PATH).
-
Constructor Details
-
AssetLoaderProvider
public AssetLoaderProvider()
-
-
Method Details
-
add
Adds anAssetLoaderthat can be retrieved and used later.- Parameters:
assetLoader- theAssetLoaderto add
-
get
Retrieves anAssetLoaderfor the desiredAssettype via the asset's class.- Type Parameters:
T- the type of Asset- Parameters:
assetClass- the class of asset to load- Returns:
- the
AssetLoaderinstance for the desired asset class - Throws:
MissingAssetLoaderException- if there is no asset loader added for the desired asset
-
loadAssetsFromAssetList
Loads assets from the mainAssetListasset (located atAssetList.PATH). Calls the onComplete callback when allAssetList.AssetDetails.isBlocking()assets have been loaded.- Parameters:
onComplete- callback that is called when all blocking assets have been loaded
-