Cleanup
This commit is contained in:
@ -179,14 +179,14 @@ class GameEngine:
|
||||
)
|
||||
|
||||
def on_purchase_timer_tick(time_left) -> None:
|
||||
logging.info(f"Product selection countdown timer tick, time left: {time_left}")
|
||||
logging.info(
|
||||
f"Product selection countdown timer tick, time left: {time_left}"
|
||||
)
|
||||
|
||||
def on_purchase_timer_done() -> None:
|
||||
logging.info("Ding ding! Product selection countdown timer timeout")
|
||||
self._purchase_countdown_timer = None
|
||||
asyncio.run(
|
||||
self.ws_server.send_product_selection_timeout_message()
|
||||
)
|
||||
asyncio.run(self.ws_server.send_product_selection_timeout_message())
|
||||
self.game_state = GameState.RUNNING
|
||||
asyncio.run(self.send_game_dump())
|
||||
|
||||
|
||||
@ -14,6 +14,13 @@ BOARD_DUMP_CHARS: dict[ObjectType, str] = {
|
||||
}
|
||||
|
||||
|
||||
def create_random_position(board_width: int, board_height: int) -> Position:
|
||||
return Position(
|
||||
x=random.randint(0, board_width - 1),
|
||||
y=random.randint(0, board_height - 1),
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class LayerObject:
|
||||
type_: ObjectType
|
||||
@ -102,10 +109,3 @@ class BoardLayout:
|
||||
)
|
||||
)
|
||||
return layers
|
||||
|
||||
|
||||
def create_random_position(board_width: int, board_height: int) -> Position:
|
||||
return Position(
|
||||
x=random.randint(0, board_width - 1),
|
||||
y=random.randint(0, board_height - 1),
|
||||
)
|
||||
|
||||
@ -10,9 +10,7 @@ from settings import settings
|
||||
|
||||
|
||||
class InactivityWatchdog(Thread):
|
||||
def __init__(
|
||||
self, players: PlayerList, ws_server: WSServer = None
|
||||
) -> None:
|
||||
def __init__(self, players: PlayerList, ws_server: WSServer = None) -> None:
|
||||
self.players = players
|
||||
self.ws_server = ws_server
|
||||
self.stop_event = Event()
|
||||
|
||||
Reference in New Issue
Block a user