Skip to content

Classes

GlobalDescription
CacheMap

CacheMap

Functions

GlobalDescription
checkTTL()

检查所有元素的TTL并移除失效的条目。 Checks TTL of all elements and removes dead ones.

getItem(key)Object | null

通过键获取缓存项。 Gets a cached item by key.

clear()

清除所有缓存条目 Clears all cache entries.

setItem(key, item)CacheEntry

设置缓存项 Sets a cache item.

update(ticks, delta)

更新缓存映射 Updates the cache map.

CacheMap

CacheMap

Kind: global class


new CacheMap(manager)

图像、音频或任何其他类型资源的缓存。
Cache for images, audio, or any other kind of resource.

ParamTypeDescription
managerObject缓存管理器 - The cache manager

checkTTL()

检查所有元素的 TTL 并移除失效的条目。
Checks TTL of all elements and removes dead ones.

Kind: global function


getItem(key) ⇒ Object | null

通过键获取缓存项。
Gets a cached item by key.

Kind: global function
Returns: Object | null - 缓存项,如果未找到则返回 null - The cached item or null if not found

ParamTypeDescription
keyString缓存元素的 URL - URL of cache element

clear()

清除所有缓存条目
Clears all cache entries.

Kind: global function


setItem(key, item) ⇒ CacheEntry

设置缓存项
Sets a cache item.

Kind: global function
Returns: CacheEntry - 缓存条目 - Cache entry

ParamTypeDescription
keyString缓存键 - Cache key
itemObject要缓存的项目 - Item to cache

update(ticks, delta)

更新缓存映射
Updates the cache map.

Kind: global function

ParamTypeDescription
ticksNumber滴答数 - Number of ticks
deltaNumber时间增量 - Time delta

贡献者

暂无相关贡献者

页面历史

暂无最近变更历史
最近更新