-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
61 lines (43 loc) · 1.64 KB
/
models.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
from datetime import datetime
class User:
def __init__(self, entry_id, email, username, hashed_password, auth_token, creation_date, admin):
self.entry_id = entry_id
self.email = email
self.username = username
self.hashed_password = hashed_password
self.auth_token = auth_token
self.creation_date = datetime.fromtimestamp(creation_date)
# Special Roles
self.admin = bool(admin)
class Lobby:
def __init__(self, entry_id, started, game_mode, difficulty, language, admin, players):
self.entry_id = entry_id
self.started = started
self.game_mode = game_mode
self.difficulty = difficulty
self.language = language
self.admin = admin
self.players = players
# Experimental
class Statistics:
def __init__(self,
current_user_count,
all_time_user_count,
staff_count,
deliveries_scheduled,
deliveries_successful,
availabilities_scheduled,
gross_fees_income,
gross_spent_by_users,
):
# Users
self.current_user_count = current_user_count
self.all_time_user_count = all_time_user_count
self.staff_count = staff_count
# Deliveries
self.deliveries_scheduled_count = deliveries_scheduled
self.deliveries_successful_count = deliveries_successful
self.availabilities_scheduled_count = availabilities_scheduled
# Finances
self.gross_fees_income = gross_fees_income
self.gross_spent_by_users = gross_spent_by_users