Classes
Global | Description |
---|---|
CacheMap | CacheMap |
Functions
Global | Description |
---|---|
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.
Param | Type | Description |
---|---|---|
manager | Object | 缓存管理器 - 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
Param | Type | Description |
---|---|---|
key | String | 缓存元素的 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
Param | Type | Description |
---|---|---|
key | String | 缓存键 - Cache key |
item | Object | 要缓存的项目 - Item to cache |
update(ticks, delta)
更新缓存映射
Updates the cache map.
Kind: global function
Param | Type | Description |
---|---|---|
ticks | Number | 滴答数 - Number of ticks |
delta | Number | 时间增量 - Time delta |
贡献者
暂无相关贡献者
页面历史
暂无最近变更历史