game-service.thrift 967 Bytes
Newer Older
1
2
include "common.thrift"

3
namespace java fr.univnantes.alma.thrift
4
namespace js common
5

6
7
// Types

8
9
struct JoinRequest {
    1: string name
10
11
}

12
13
14
struct TPlayer {
    1: string token,
    2: string name,
15
    3: string address,
16
    4: i32 port
17
18
}

19
struct TRoomId {
20
21
22
23
24
25
    1: string token
}


//Service

26
service GameService {
27

28
    TRoomId createRoom(TPlayer player) throws (1:common.InvalidOperationException e)
29

30
    common.Response sendStartGame(TPlayer player, i32 creatureId, common.TBoard board, common.TColor color, list<common.TCard> placeCards)
31

32
    common.Response joinRoom(TPlayer player, TRoomId roomId)
33

34
    common.TDescription getGameDescription(TPlayer player)
35

36
    void sendFinishPhase(TPlayer player, common.TPhase phase)
37

38
    void sendPlayCards(TPlayer player, list<common.TCard> playerCards)
39

40
    void sendPlaceJetons(TPlayer player, list<common.TPlacedJeton> placedJetons)
41

42
    void sendResist(TPlayer player, i32 number)
43

44
    void sendGiveUp(TPlayer player)
45
}