Asset

data class Asset<T>(val descriptor: AssetDescriptor<T>, val identifier: Identifier<T> = descriptor.toIdentifier(), val reference: CompletableDeferred<T> = CompletableDeferred(), val dependencies: List<Asset<*>>, val loader: Loader<T>, var referenceCount: Int = 0)

Container for a single asset of type T managed by AssetStorage.

Constructors

Link copied to clipboard
constructor(descriptor: AssetDescriptor<T>, identifier: Identifier<T> = descriptor.toIdentifier(), reference: CompletableDeferred<T> = CompletableDeferred(), dependencies: List<Asset<*>>, loader: Loader<T>, referenceCount: Int = 0)

Properties

Link copied to clipboard

Lists asset dependencies that require loading.

Link copied to clipboard

Stores asset loading data.

Link copied to clipboard

Unique identifier of the asset.

Link copied to clipboard

Used to load the asset.

Link copied to clipboard
val reference: CompletableDeferred<T>

Stores reference to the actual asset once it is loaded.

Link copied to clipboard

Control variable. Lists how many times the asset is referenced by other assets as dependency or by direct manual load requests.