From 8f1438964e1a336c44609cd4cc4c6aef61137011 Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Thu, 17 Oct 2024 10:38:41 +0200 Subject: Added content to the README and reordered the code --- model.py | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'model.py') diff --git a/model.py b/model.py index 904265f..f768d0f 100644 --- a/model.py +++ b/model.py @@ -1,7 +1,6 @@ from math import floor from csv import reader from typing import Tuple -from time import time, strftime from dataclasses import dataclass MIN_LEVEL = 1 @@ -102,33 +101,3 @@ class PlayerList: } players.update(guests) return players - - -@dataclass -class Timer: - ref: float = None - running: bool = False - max_mins: int = 1 - default: str = ("00", "00") - - def __post_init__(self): - self.max_seconds = self.max_mins * 60 - - def start(self): - self.ref = time() + self.max_seconds - self.running = True - - def stop(self): - self.ref = None - self.running = False - - def get(self): - if not self.running: - return self.default - total_seconds = self.ref - time() - if total_seconds < 0: - self.stop() - return self.default - mins = f"{int(total_seconds // 60):02d}" - secs = f"{int(total_seconds % 60):02d}" - return mins, secs -- cgit v1.3.1