-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.cge
66 lines (56 loc) · 1.56 KB
/
events.cge
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name tic_tac_toe_extended
version 0.4
config {
// The amount of marked squares in any direction required to win. default = `3`;
// minimum = `3`
win_row_size: int,
// The side length of the board. Equals the board size by calculating `board_size^2`.
// default = `(player_count + 1)^2`; minimum = `3`
board_size: int,
}
// Starts or restarts the game before the maximum, but after
// the minumum, player count is reached.
command start {}
// Notifies everyone that the game has started.
event started {}
// Notifies the player of the current board.
event board {
// The board as rows of columns.
board: list<string>,
}
// Marks a field with the player's symbol.
command mark {
// The field index.
field: int,
}
// Notifies the player that a field has been marked.
event marked {
// The field index.
field: int,
}
// Notifies the player that the action they want to take is forbidden (at the moment).
event forbidden_action {
// A message detailing what and why the action is forbidden.
message: string
}
// Notifies the player that it is their turn.
event my_turn {}
// Notifies the player that it is an opponents turn.
event opponents_turn {
// The ID of the player who's turn it is.
player: string
}
// Notifies the players that the game has ended.
event finish {
// The game's outcome.
result: enum result {
// The player that receives this variant has won.
winner,
// The player that receives this variant has lost.
looser,
// It's a draw.
draw
},
// The winner's player ID if it was not a draw.
winner: string
}