-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameLiveData.py
43 lines (40 loc) · 1.39 KB
/
GameLiveData.py
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
"""Provides GameLiveData class, which is communicated to robots"""
class GameLiveData:
"""Holds data to be sent to robots"""
def __init__(self):
self.gameOn = False
self.timeLeft = 0
self.team1 = {
"id" : 0,
"name" : "team1",
"score" : 0
}
self.team2 = {
"id" : 1,
"name" : "team2",
"score" : 0
}
self.field = {
"topLeft" : [0,0],
"topRight" : [0,0],
"bottomLeft": [0,0],
"bottomRight": [0,0],
"baskets": { "team1" : {
"topLeft" : [0,0],
"topRight" : [0,0],
"bottomLeft": [0,0],
"bottomRight": [0,0]
},
"team2" : {
"topLeft" : [0,0],
"topRight" : [0,0],
"bottomLeft": [0,0],
"bottomRight": [0,0]
}
}
}
self.apples = []
self.robots = []
#def toJSON(self):
# return json.dumps(self, default=lambda o: o.__dict__,
# sort_keys=False, indent=4)