UNPKG

@runox-game/game-engine

Version:
25 lines (24 loc) 923 B
import { GameCommand } from './game.command'; import { IGameState } from '../models/game-state.model'; import { Observable } from 'rxjs'; /** * Class in charge of grouping the execution of commands that alter the game state */ export declare class CommandsInvoker { private readonly commands; /** * Class in charge of grouping the execution of commands that alter the game state * * @param commands - commands to execute */ constructor(commands: GameCommand[]); /** * Loops through the list of commands validating that they can be executed * and executing if there are no errors during validation * * @param currentState - current game state * @returns observable with the intention of being able to track the success or failure * of the command group invocation */ invoke(currentState: IGameState): Observable<void>; }