-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatchClass.py
150 lines (83 loc) · 3.88 KB
/
MatchClass.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
class SingleMatch:
def __init__(self, PersonId):
self.id = PersonId
self.match = {}
self.match[str(PersonId)] = {}
def display(self):
print("\n\n NEW MATCH \n\nmatchId, ", self.id, "\n\n")
for people in self.match:
#print people, "", self.match[self.id][people]
for data in self.match[people]:
print(data, "", self.match[people][data])
print(" ")
def getId(self):
return self.id
def getMatch(self):
return self.match
def addMatchIDtoPlayers(self, playerId):
self.match[playerId]["matchId"] = self.id
def addPlayer(self, playerId):
#print team, playerId
self.match[str(playerId)] = {}
def addKills(self, playerId, kills):
self.match[playerId]["kills"] = kills
def addAssists(self, playerId, assists):
self.match[playerId]["assists"] = assists
def addScore(self, playerId, score):
self.match[playerId]["score"] = score
def getScore(self, playerId):
return self.match[playerId]["score"]
def addAVGLIFE(self, playerId, lifespane):
self.match[playerId]["averageLifespan"] = lifespane
def addAVG_K_DIST(self, playerId, AVGKDIST):
self.match[playerId]["averageKillDistance"] = AVGKDIST
def addSecondsPlayed(self, playerId, SecPlay):
self.match[playerId]["secondsPlayed"] = SecPlay
def addDeaths(self, playerId, deaths):
self.match[playerId]["deaths"] = deaths
def addAVGScorePerKill(self, playerId, AVGSCRPKILL):
self.match[playerId]["averageScorePerKill"] = AVGSCRPKILL
def addAVGScorePerLife(self, playerId, AVGSCRPLIFE):
self.match[playerId]["averageScorePerLife"] = AVGSCRPLIFE
def addStanding(self, playerId, standing):
self.match[playerId]["standing"] = standing
def addmeleeKills(self, playerId, mKills):
self.match[playerId]["weaponKillsMelee"] = mKills
def addsuperKills(self, playerId, sKills):
self.match[playerId]["weaponKillsSuper"] = sKills
def addBestWeapon(self, playerId, best):
self.match[playerId]["weaponBestType"] = best
def addCompletion(self, playerId, comp):
self.match[playerId]["completed"] = comp
def addKD(self, playerId, KD):
self.match[playerId]["killsDeathsRatio"] = KD
def addKAD(self, playerId, KAD):
self.match[playerId]["killsDeathsAssists"] = KAD
def addActiveDuration(self, playerId, duration):
self.match[playerId]["activityDurationSeconds"] = duration
def addTeamScore(self, TS):
self.match["teamScore"] = TS
def addPlayerClass(self, playerId, pClass):
self.match[playerId]["class"] = pClass
def addLL(self, playerId, LL):
self.match[playerId]["lightLevel"] = LL
def addCR(self, playerId, CR):
self.match[playerId]["combatRating"] = CR
def addPrimaries(self, playerId, numPrimKills):
self.match[playerId]["weaponKillsPrimary"] = numPrimKills
def addSecondaries(self, playerId, numSecKills):
self.match[playerId]["weaponKillsSecondary"] = numSecKills
def addHeavy(self, playerId, numHeavyKills):
self.match[playerId]["weaponKillsHeavy"] = numHeavyKills
def addAbilityKills(self, playerId, abilityKills):
self.match[playerId]["weaponKillsOther"] = abilityKills
def addpercentContrib(self, playerId, yourScore, teamScore):
if teamScore == 0.0 or teamScore == 0:
teamScore = 0.1
self.match[playerId]["percentContribution"] = float(yourScore/teamScore)
def addTeam(self, playerId, team):
if team == "Alpha":
team = 16
else:
team = 17
self.match[playerId]["team"] = team