-
Notifications
You must be signed in to change notification settings - Fork 0
/
shot.py
51 lines (48 loc) · 1.61 KB
/
shot.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
42
43
44
45
46
47
48
49
50
51
class Shot:
def __init__(self):
self.distance_before = None
self.distance_after = None
self.shot_length = None
self.category_before = None
self.category_after = None
self.x = None
self.y = None
self.player_id = None
self.player = None
self.round = None
self.shot = None
self.par = None
self.hole = None
self.type = None
def csv_dump(self):
return [self.player_id,
self.player,
self.shot,
self.round,
self.par,
self.hole,
self.type,
self.distance_before,
self.distance_after,
self.shot_length,
self.category_before,
self.category_after,
self.x,
self.y]
def __str__(self):
return "Shot <" + \
"player_id=" + str(self.player_id) + \
",player=" + str(self.player) + \
",shot=" + str(self.shot) + \
",round=" + str(self.round) + \
",par=" + str(self.par) + \
",hole=" + str(self.hole) + \
",type=" + str(self.type) + \
",distance_before=" + str(self.distance_before) + \
",distance_after=" + str(self.distance_after) + \
",shot_length=" + str(self.shot_length) + \
",category_before=" + str(self.category_before) + \
",category_after=" + str(self.category_after) + \
",x=" + str(self.x) + \
",y=" + str(self.y) + \
">"