import { CollectionActionDefinition, CollectionContext } from "../actions/collection/collection.js"; import { ClientMessageContext } from "../conditions/context/clientMessage.js"; import type { Player, ServerPlayerMessage } from "../player/index.js"; import type { Room } from "../room/base.js"; import type { State } from "../state/state.js"; import { RootActionDefinition } from "../actions/root/rootAction.js"; import type { Command } from "../command.js"; /** * @ignore */ export declare class CommandsManager { private readonly room; history: Command[]; /** * Map of clientID to a tuple of: * * - compound action object * - data gathered from that action, for this player */ pendingActions: Map; context: CollectionContext; }>; possibleActions: RootActionDefinition; constructor(room: Room); /** * @throws when all actions fail to execute * @returns TODO: why would this return? */ handlePlayerEvent(message: ServerPlayerMessage): Promise; run(message: ServerPlayerMessage, action: CollectionActionDefinition, context: CollectionContext): Promise; runPrerequisites(messageContext: ClientMessageContext, action: CollectionActionDefinition, actionContext: CollectionContext): boolean; runConditions(message: ServerPlayerMessage, messageContext: ClientMessageContext, action: CollectionActionDefinition, context: CollectionContext): boolean; pickCommand(messageContext: ClientMessageContext, action: CollectionActionDefinition, context: CollectionContext): Command; handlePendingActions(message: ServerPlayerMessage, action: CollectionActionDefinition, context: CollectionContext): void; executeCommand(state: S, command: Command): Promise; undoLastCommand(state: S): Promise; /** * There were no successful actions remaining. * @throws */ private runFailed; private runSuccessful; /** * Call when all actions fail on conditions check. * Will send the message back to player, with reasons for failure. */ private reportFailedActionConditions; private sendMessage; }