import type { ClientMessageConditions, ClientMessageContext } from "../../conditions/context/clientMessage.js"; import type { State } from "../../state/state.js"; import type { Command } from "../../command.js"; import type { BaseActionDefinition } from "../base.js"; import type { CollectionActionDefinition, CollectionConditionsResult, CollectionContext } from "../collection/collection.js"; import { CompoundActionChild } from "./types.js"; /** * TODO: decide what to do * 1. game-moving-cards-test-server has a use case * 2. no idea how to make bots deal with compound actions... */ /** * ~~@deprecated Focus on drag&drop. Continue with compound once you find a CONCRETE use case for it.~~ * game-moving-cards-test-server might be enough of use case * @category Action definitions * @ignore */ export interface CompoundActionTemplate { name: string; actions: CompoundActionChild[]; /** * A mean to back out of completing this compound action. * Allows you to perform any game state cleanups. * Will be checked before any other action in this group. * * Examples might include user ending drag: * * - on the starting position (cancelling) * - away, without any entity under the pointer * - on invalid target */ abortActions?: CompoundActionChild[]; /** * An action which also marks this whole compound action as success. * * Example: user ends drag on a valid target * * At least one "finishAction" is required. */ finishActions: [CompoundActionChild, ...CompoundActionChild[]]; } /** * @ignore * ~~@deprecated Focus on drag&drop. Continue with compound once you find a CONCRETE use case for it.~~ * game-moving-cards-test-server might be enough of use case * @ignore */ export declare function isCompoundActionTemplate(o: unknown): o is CompoundActionTemplate; /** * ~~@deprecated Focus on drag&drop. Continue with compound once you find a CONCRETE use case for it.~~ * game-moving-cards-test-server might be enough of use case * @ignore */ export type CompoundContext = { successfulActions: Set>; successfulAbort: Set>; successfulFinish: Set>; aborted: boolean; finished: boolean; }; /** * ~~@deprecated Focus on drag&drop. Continue with compound once you find a CONCRETE use case for it.~~ * game-moving-cards-test-server might be enough of use case * @ignore */ export declare class CompoundActionDefinition implements CollectionActionDefinition> { private template; name: string; actions: readonly CompoundActionChild[]; finishActions: readonly CompoundActionChild[]; abortActions: readonly CompoundActionChild[]; constructor(template: CompoundActionTemplate); setupContext(): CompoundContext; teardownContext(context: CollectionContext>): void; checkPrerequisites(messageContext: ClientMessageContext, context: CollectionContext>): boolean; checkConditions(test: ClientMessageConditions, messageContext: ClientMessageContext, context: CollectionContext>): CollectionConditionsResult>; getCommand(messageContext: ClientMessageContext, context: CollectionContext>): Command; /** * Marks if after execution either "lastAction" or "cancelAction" executed successfully. * Manager should remove this action from its own "pendingActions" record */ hasFinished(context: CollectionContext>): boolean; hasSuccessfulSubActions(context: CollectionContext>): boolean; getSuccessfulAction(context: CollectionContext>): CompoundActionChild; _successfulActionsCount(context: CollectionContext>): number; _allActionsCount(): number; } /** * @ignore * ~~@deprecated Focus on drag&drop. Continue with compound once you find a CONCRETE use case for it.~~ * game-moving-cards-test-server might be enough of use case */ export declare function isCompoundActionDefinition(o: unknown): o is CompoundActionDefinition; /** * @ignore * ~~@deprecated Focus on drag&drop. Continue with compound once you find a CONCRETE use case for it.~~ * game-moving-cards-test-server might be enough of use case */ export declare function isCompoundActionDefinition_quick(o: unknown): o is CompoundActionDefinition; /** * ~~@deprecated Focus on drag&drop. Continue with compound once you find a CONCRETE use case for it.~~ * game-moving-cards-test-server might be enough of use case * @category Action definitions */ export declare function defineCompoundAction(template: CompoundActionTemplate): CompoundActionDefinition;