-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.py
More file actions
37 lines (30 loc) · 928 Bytes
/
db.py
File metadata and controls
37 lines (30 loc) · 928 Bytes
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
from storm.locals import *
def init():
# database = create_database("scheme://username:password@hostname:port/database_name")
SCHEME = 'sqlite'
USER = 'user'
PASS = 'pass'
HOST = 'localhost'
PORT = '??'
DB_NAME = 'killerhouse'
database = create_database("{0}://{1}:{2}@{3}:{4}/{5}".format(SCHEME, USER, PASS, HOST, PORT, DB_NAME))
class DBObject():
pass
class User(DBObject):
__storm_table__ = 'user'
name = '' # Name it is playing with
games = [] # List of groups
targets = {} # List of targets (one or none per group)
def getTarget(groupId):
# ONE TARGET
# NO TARGET (IF USER IS DEAD)
# EXCEPTION (IF USER NOT IN GAME)
pass
class Game(DBObject):
users = [] # List of users
def getUsers():
pass
class Target(DBObject):
user = '' # ID (tg name?) of target user
weapon = '' # Weapon to use
location = '' # Location to use