UNPKG

@rpgjs/physic

Version:

A deterministic 2D top-down physics library for RPG, sandbox and MMO games

21 lines 647 B
export interface QueuedInput<T> { frame: number; tick: number; timestamp: number; payload: T; } /** * Deterministic per-player input buffer. * * Keeps inputs ordered by frame, deduplicates frames, and allows consuming * the queue atomically for each simulation tick. */ export declare class DeterministicInputBuffer<T = unknown> { private readonly queues; enqueue(playerId: string, input: QueuedInput<T>): void; consume(playerId: string): QueuedInput<T>[]; pendingCount(playerId: string): number; clear(playerId: string): void; clearAll(): void; } //# sourceMappingURL=DeterministicInputBuffer.d.ts.map