roguelike-pumpkin-patch
Version:
A roguelike development library in JavaScript.
17 lines (16 loc) • 657 B
TypeScript
import { EventManagerParams, ManagedEvent, Actor } from './EventManagerInterfaces.js';
/** Event manager, to keep track of turns */
export default class EventManager {
readonly type: "simple" | "complex";
private queue;
private time;
constructor(parameters?: EventManagerParams);
/** Add an event to the queue */
add(addedEvent: ManagedEvent | Actor | (() => Promise<any> | void)): void;
/** Run the next event */
advance(): Promise<void>;
/** Remove actor from the event queue */
remove(actor: object): void;
/** Determine the number of queued events in the queue. */
get length(): number;
}