-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.proto
87 lines (75 loc) · 1.78 KB
/
api.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
syntax = "proto2";
import "google/protobuf/empty.proto";
package protobuf;
option java_multiple_files = true;
option java_package = "org.CueCraft.protobuf";
option java_outer_classname = "ApiProtos";
service CueCanvasAPI {
rpc ShowShots (ShowShotsRequest) returns (google.protobuf.Empty) {}
rpc ShowGames (ShowGamesRequest) returns (google.protobuf.Empty) {}
}
message ShowShotsRequest {
required TableState tableState = 1;
repeated Shot shots = 2;
}
message ShowGamesRequest {
repeated Game games = 1;
}
message Game {
repeated GameTurn turnHistory= 1;
}
message GameTurn {
required string turnType = 1;
required string agentName = 2;
required TableState tableStateBefore = 3;
required TableState tableStateAfter = 4;
required GameShot gameShot = 5;
required string shotResult = 6;
}
message GameShot {
required ShotParams shotParams = 1;
required string decision = 2;
required string ballTarget = 3;
required string pocketTarget = 4;
required Point cuePos = 5;
}
message ShotParams {
required double a = 1;
required double b = 2;
required double phi = 3;
required double theta = 4;
required double v = 5;
}
message TableState {
repeated Ball balls = 1;
}
message Ball {
required Point pos = 1;
required int32 number = 2;
required int32 state = 3;
}
message Point {
required double x = 1;
required double y = 2;
}
message Shot {
required ShotType type = 1;
optional Shot next = 2;
optional Shot branch = 3;
optional Point posB1 = 4;
optional Point ghostBall = 5;
optional Point leftMost = 6;
optional Point rightMost = 7;
optional int32 b1 = 8;
optional int32 b2 = 9;
required int32 id = 10;
}
enum ShotType {
CUE_STRIKE = 0;
POCKET = 1;
RAIL = 2;
STRIKE = 3;
KISS_LEFT = 4;
KISS_RIGHT = 5;
BALL_BOTH = 6;
}