Commit f7242668 authored by Mamadou Saliou DIALLO's avatar Mamadou Saliou DIALLO
Browse files

refactor: standarize common struct client and sever

parent 1bfd5cb9
......@@ -10,12 +10,40 @@ exception GameNotFound {
1: i32 code,
2: string description
}
struct Winner {
1: Player winner,
2: string message
}
struct TrackingKard {
1: i32 phase,
2: string name,
3: bool visible
}
struct PlaceCard {
1: i32 number,
2: string name,
3: bool visible
}
enum PlayerState {
UNBLOCKED = 0,
BLOCKED
}
struct PlayerStateResponse {
1: PlayerState state,
2: string message
}
struct Player{
1: i32 id
2: string name
3: string ip
4: string port
5: PlayerState state,
6: optional list<TrackingKard> huntCards,
7: optional list<PlaceCard> placeCards,
}
......
......@@ -3,51 +3,19 @@ include "common.thrift"
namespace java fr.univnantes.alma.thrift
namespace js common
enum PlayerState {
UNBLOCKED = 0,
BLOCKED
}
struct PlayerStateResponse {
1: PlayerState state,
2: string message
}
struct GamePlayer {
1: i32 id,
2: string name,
3: PlayerState state,
4: optional list<HuntCard> huntCards,
5: optional list<PlaceCard> placeCards,
}
struct Winner {
1: GamePlayer winner,
2: string message
}
struct HuntCard {
1: i32 phase,
2: string name,
3: bool visible
}
struct PlaceCard {
1: i32 number,
2: string name,
3: bool visible
}
struct BoardGameState {
1: i32 assimilationTokenPosition,
2: i32 rescuePawnPosition,
3: optional bool isBoardFacing,
4: list<GamePlayer> players
4: list<common.Player> players
}
service PlayerService {
bool ping() throws (1:common.InvalidOperationException e)
string startGame(i32 gameId)
PlayerStateResponse blockActions()
PlayerStateResponse unblockActions()
common.PlayerStateResponse blockActions()
common.PlayerStateResponse unblockActions()
void showPlayedCard()
string updatedGameBoard(BoardGameState bordGameState)
string endGame(Winner winner);
string endGame(common.Winner winner);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment