-
Notifications
You must be signed in to change notification settings - Fork 8
/
events.proto
63 lines (54 loc) · 997 Bytes
/
events.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
52
53
54
55
56
57
58
59
60
61
62
63
syntax="proto3";
package tinyrpg;
enum Direction {
left = 0;
right = 1;
up = 2;
down = 3;
}
message Unit {
string id = 1;
double x = 2;
double y = 3;
int32 frame = 4;
string skin = 5;
string action = 6;
double speed = 7;
Direction direction = 8;
Direction side = 9;
}
message Event {
enum Type {
type_init = 0;
type_connect = 1;
type_exit = 2;
type_idle = 3;
type_move = 4;
type_empty = 5;
}
Type type = 1;
oneof data {
EventInit init = 2;
EventConnect connect = 3;
EventExit exit = 4;
EventIdle idle = 5;
EventMove move = 6;
}
}
message EventInit {
string player_id = 1;
map<string, Unit> units = 2;
}
message EventConnect {
Unit unit = 1;
}
message EventExit {
string player_id = 1;
}
message EventIdle {
string player_id = 1;
}
message EventMove {
string player_id = 1;
Direction direction = 2;
}