mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-22 18:15:27 -04:00
f871b64011
* The collision mask is read from the tile maps exported by Tiled 1.9+. * Several collision masks can be used for instance to have platforms and ladders. * Take a look to the wiki for more details https://wiki.gdevelop.io/gdevelop5/objects/tilemap
28 lines
796 B
TypeScript
28 lines
796 B
TypeScript
/**
|
|
* A cache of resources identified by a string.
|
|
*
|
|
* It ensures that a resource is never load twice.
|
|
*/
|
|
export declare class ResourceCache<T> {
|
|
private _cachedValues;
|
|
/**
|
|
* Several calls can happen before the resource is loaded.
|
|
* This allows to stack them.
|
|
*/
|
|
private _callbacks;
|
|
constructor();
|
|
/**
|
|
* Return a resource through a call back.
|
|
* @param key the resource identifier.
|
|
* @param load load the resource in case of cache default.
|
|
* Note that the load callback is used by `getOrLoad` and not by the caller.
|
|
* @param callback called when the resource is ready.
|
|
*/
|
|
getOrLoad(
|
|
key: string,
|
|
load: (callback: (value: T | null) => void) => void,
|
|
callback: (value: T | null) => void
|
|
): void;
|
|
}
|
|
//# sourceMappingURL=ResourceCache.d.ts.map
|