2019-10-02 03:42:21 +00:00
|
|
|
from ..app import db, ma
|
|
|
|
import enum
|
|
|
|
|
|
|
|
class TimeTypes(enum.Enum):
|
|
|
|
BYOYOMI = "Counting by time period"
|
|
|
|
ABSOLUTE = "One period to use time"
|
|
|
|
HOURGLASS = "Absolute time for both players"
|
|
|
|
NONE = "Untimed"
|
|
|
|
|
|
|
|
class TimeSettings(db.Model):
|
2019-10-02 20:55:09 +00:00
|
|
|
__table_args__ = {'extend_existing': True}
|
2019-10-02 03:42:21 +00:00
|
|
|
|
2019-10-02 20:55:09 +00:00
|
|
|
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
|
|
|
main_time = db.Column(db.Enum(TimeTypes), nullable=False)
|
2019-10-02 03:42:21 +00:00
|
|
|
time_period = db.Column(db.Integer) # number of periods
|
|
|
|
period_length = db.Column(db.Integer) # seconds
|
2019-10-02 20:55:09 +00:00
|
|
|
overtime = db.Column(db.Enum(TimeTypes), nullable=False)
|
2019-10-02 03:42:21 +00:00
|
|
|
overtime_period = db.Column(db.Integer) # number of overtime periods
|
|
|
|
overtime_length = db.Column(db.Integer) # seconds
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
pass
|