-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.py
28 lines (20 loc) · 807 Bytes
/
stats.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
import time
class Stats:
def __init__(self, stats={}):
if (stats == None):
stats = {}
self.lastAsked = stats.get('lastAsked', 0)
self.asked = stats.get('asked', 0)
self.mistakes = stats.get('mistakes', 0)
self.guessings = stats.get('guessings', 0)
self.reminders = stats.get('reminders', 0)
self.VVasked = stats.get('VVasked', 0)
self.VVguessings = stats.get('VVguessings', 0)
self.VVmistakes = stats.get('VVmistakes', 0)
self.VVreminders = stats.get('VVreminders', 0)
def updateParam(self, param):
setattr(self, param, getattr(self, param) + 1)
if(param == 'asked' or param == 'VVasked'):
self.lastAsked = time.time()
def getDict(self):
return self.__dict__