UNPKG

@runox-game/game-engine

Version:
23 lines (22 loc) 882 B
import { GameCommand } from './game.command'; import { IGameState } from '../models/game-state.model'; import { CommandValidation } from './command-result'; import { ICard } from '../models/card.model'; /** * Class that allows a player to play a card from his hand */ export declare class PlayCardCommand extends GameCommand { private readonly playerId; private readonly card; private readonly toPlayerId?; /** * Class that allows a player to play a card from his hand * * @param playerId - identifier of the player who wants to play a card * @param card - card to be played * @param toPlayerId - identifier of the player who will receive the card */ constructor(playerId: string, card: ICard, toPlayerId?: string); execute(state: IGameState): void; validate(state: IGameState): CommandValidation; }