game.ts 910 Bytes
Newer Older
1
2
import { TPlayer, TRoomId, TBoard, TColor, TCard, TPlacedJeton, TPhase, TDescription } from 'src/codegen/common';

3
4
export interface GameInterface {

5
/*
6
7
    createGame(numberOfPlayers: number): Promise<number>;
    join(gameId: number): Promise<number>;
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
*/
    createRoom(player: TPlayer): Promise<TRoomId>;

    sendStartGame(player: TPlayer, creatureId: number, board: TBoard, color: TColor, placeCards: TCard[]): Promise<Response>;

    joinRoom(player: TPlayer, roomId: TRoomId): Promise<Response>;

    getGameDescription(player: TPlayer): Promise<TDescription>;

    sendFinishPhase(player: TPlayer, phase: TPhase): Promise<void>;

    sendPlayCards(player: TPlayer, playerCards: TCard[]): Promise<void>;

    sendPlaceJetons(player: TPlayer, placedJetons: TPlacedJeton[]): Promise<void>;

    sendResist(player: TPlayer, number: number): Promise<void>;
24

25
    sendGiveUp(player: TPlayer): Promise<void>;
26
}