Get rid of original/reference code, move everything to root

This commit is contained in:
2022-11-11 20:34:34 -06:00
parent dbaa692711
commit e9e8ebcc1e
35 changed files with 3 additions and 633 deletions

33
game/new_game.py Normal file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python3
# Copyright 2022 - c0de <c0de@c0de.dev>
# Licensed under the MIT License (https://opensource.org/licenses/MIT)
# pylint: disable=missing-module-docstring
import uuid
from database.models import GameModel as Game
from game.base import BaseGameManager
class NewGameManager(BaseGameManager):
"""Commands that run at the start of a new game"""
def __init__(self):
super().__init__()
self.commands.append(("braveball", self.start))
async def start(self):
"""
Start command - Starts a new game if there isn't already one running
"""
if self.is_running:
return await self.message.channel.send("A game is already running")
self.is_running = True
# game.pitch_value is unknown at the start of the game
self.game = Game.create(game_id=uuid.uuid4(), server_id=self.message.channel.id)
await self.message.channel.send("Send me your guesses with !guess <number>")