-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgame.proto
51 lines (44 loc) · 1.02 KB
/
game.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
syntax = "proto3";
package rummy;
import "github.com/timpalpant/rummy/deck/deck.proto";
message Meld {
repeated deck.Card cards = 1;
}
message PlayerState {
int32 id = 1;
string name = 2;
repeated Meld melds = 3;
repeated deck.Card rummies = 4;
int32 num_cards_in_hand = 5;
int32 current_score = 6;
}
message GameState {
enum TurnState {
TURN_START = 0;
PICKED_UP_CARDS = 1;
PLAYED_CARDS = 2;
}
int32 num_cards_in_stock = 1;
repeated deck.Card discard_pile = 2;
repeated Meld aggregated_melds = 3;
repeated PlayerState players = 4;
int32 turn = 6;
int32 current_player_turn = 7;
TurnState turn_state = 8;
bool game_over = 9;
}
message GameEvent {
enum Type {
UNKNOWN_TYPE = 0;
TURN_START = 1;
PICK_UP_STOCK = 2;
PICK_UP_DISCARD = 3;
PLAY_CARDS = 4;
DISCARD = 5;
GAME_OVER = 6;
}
int32 player_id = 1;
Type type = 2;
repeated deck.Card cards = 3;
int32 score = 4;
}