various visual and performance updates

This commit is contained in:
Yannik Schmidt
2020-09-30 07:10:17 +02:00
parent 08d3a5ae1b
commit 530624ffe8
10 changed files with 181 additions and 113 deletions

View File

@@ -12,8 +12,9 @@ class Round:
losersParsed = json.loads(losers)
self.startTime = startTime
self.winners = [ player.playerFromDict(wp) for wp in winnersParsed ]
self.losers = [ player.playerFromDict(lp) for lp in losersParsed ]
self.id = int(float(timestamp))
self.winners = [ player.playerFromDict(wp, int(duration)) for wp in winnersParsed ]
self.losers = [ player.playerFromDict(lp, int(duration)) for lp in losersParsed ]
self.winnerSide = winnerSide
self.duration = datetime.timedelta(seconds=int(duration))
@@ -28,10 +29,13 @@ class Round:
else:
self.mapName = "unavailiable"
self.confidence = int(confidence * 100)
if prediction == 0:
self.confidence = (int(confidence * 100) - 50)*2
self.quality = int(150 - self.confidence)
if self.confidence < 50:
self.prediction = "-"
elif prediction == 0:
self.prediction = self.winnerSideString
elif prediction == 1:
self.prediction = self.loserSideString
else:
self.prediction = "Error"
self.prediction = "Error"