-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutility.py
37 lines (26 loc) · 976 Bytes
/
utility.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
import sqlite3
class Pilot:
def __init__(self, *, id: int = -1, gid: int = -1, name: str = None, nick: str = None, guild: str = None,
roles: list = None):
self.id = id
self.git = gid
self.name = name
self.nick = nick
self.guild = guild
self.roles = roles
class PilotStatistic:
def __init__(self, *, date: str = None, ranks: list = None, zones: int = None, kills: dict = None,
achievements: list = None):
self.date = date
self.ranks = ranks
self.zones = zones
self.kills = kills
self.achievements = achievements
class PilotHandler:
def __init__(self):
self.pilots = list()
self.pilot_set = set()
def add_pilot(self, *, pilot: Pilot = Pilot(),
stat: PilotStatistic = PilotStatistic()) -> None:
self.pilots.append((pilot, stat))
def load(self, table: str, db_cursor: sqlite3.Cursor):