dotup-ts-node-skills-game
Version:
Develop alexa typescript games
37 lines (36 loc) • 1.52 kB
TypeScript
import { services } from 'ask-sdk-model';
import { IDirective, IRequestContext } from 'dotup-ts-node-skills';
import { GameState } from '../Constants/Enumerations';
import { ITurnOrder } from '../Interfaces/ITurnOrder';
import { GameEngineInput } from './GameEngineInput';
import { GameModel } from './GameModel';
/**
* Nice game
*/
export declare abstract class AlexaGame<T extends GameModel> extends GameEngineInput {
private readonly turnOrder;
protected readonly model: T;
protected readonly context: IRequestContext;
protected readonly waitToContinueGameDuration: number;
readonly state: GameState;
constructor(context: IRequestContext, model: T, turnOrder: ITurnOrder, waitToContinueGameDuration: number);
abstract Start(): void;
protected abstract OnEvent(eventName: string, inputEvent: services.gameEngine.InputEvent): void;
Stop(): void;
ContinueGame(): void;
protected getAllIds(): string[];
protected InitializeButtonColors(): IDirective[];
/**
* Ask player for correct button
*/
protected Timeout(item: services.gameEngine.InputHandlerEvent): void;
protected TryStart(): void;
protected Event(eventName: string, inputEvent: services.gameEngine.InputEvent): void;
/**
* Analyse the answer. Later do it with Recognizer.
*
* One for RightAnswer. type match with correct gadget id.
* Ans one for WrongAnswer. "type": "deviation" with the two wrong gadget ids.
*/
protected onGameCompleted(): void;
}