PoseCache<T>
A least-recently-used cache under a byte budget, from makePoseCache.
Defined in: engine/src/animation/cache.ts:10
Type Parameters
Methods
drop()
drop(prefix: string): void;Defined in: engine/src/animation/cache.ts:16
Drop everything whose key starts with prefix (e.g. one damaged creature).
Parameters
| Parameter | Type |
|---|---|
prefix | string |
Returns
void
get()
get(key: string, make: () => T): T;Defined in: engine/src/animation/cache.ts:12
The cached value for key, made (and counted as a miss) if absent.
Parameters
| Parameter | Type |
|---|---|
key | string |
make | () => T |
Returns
T
peek()
peek(key: string): T | undefined;Defined in: engine/src/animation/cache.ts:14
The cached value if present (counted as a hit), without making one.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
T | undefined
resetStats()
resetStats(): void;Defined in: engine/src/animation/cache.ts:20
Zero the hit and miss counters.
Returns
void
stats()
stats(): object;Defined in: engine/src/animation/cache.ts:18
Entries, estimated bytes held, and hits and misses since the last resetStats.
Returns
object
bytes
bytes: number;entries
entries: number;hits
hits: number;misses
misses: number;