From e9154711c05126a4157136bbb915a39b6f7ea85a Mon Sep 17 00:00:00 2001 From: Zed Date: Thu, 2 Mar 2023 17:52:40 -0600 Subject: [PATCH] Removed add player guess to resolve --- game/end_game.py | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/game/end_game.py b/game/end_game.py index f269dcf..ec52fbd 100644 --- a/game/end_game.py +++ b/game/end_game.py @@ -12,42 +12,20 @@ from game.process_guess import ProcessGuess class EndGameManager(BaseGameManager): - """Commands that run at the end of a game""" + """Commands that run at the end of a play""" def __init__(self): super().__init__() self.commands.append(("resolve", self.stop)) - def __stop_args__(self): - pieces = self.message.content.split() - - if len(pieces) == 2: - return pieces[1], False, None, None - - if len(pieces) == 4: - return pieces[1], True, pieces[2], pieces[3] - - return None, False, None, None - async def update_pitch_value(self): """Update game state database for closing arguments""" - # Determine arguments - pitch_value, has_batter, batter_id, batter_guess = self.__stop_args__() + pitch_value = self.message.content.split()[1] if not pitch_value: return await self.message.channel.send( f"Invalid command <@{ str(self.message.author.id) }>!" ) - if has_batter: - player_id = batter_id[3:] - player_name = await self.discord.get_user(int(player_id).name) - Guess.create( - game_id=self.game.game_id, - player_id=player_id, - player_name=player_name, - guess=int(batter_guess), - ).save() - # Save the pitch value Game.update( { @@ -76,7 +54,7 @@ class EndGameManager(BaseGameManager): ) # Discard the game if there weren't enough players - if guess_count < 3: + if guess_count < 2: self.game = None self.is_running = False return await self.message.channel.send( @@ -85,7 +63,7 @@ class EndGameManager(BaseGameManager): message = ( "Closed this play! Here are the results\n" - + "PLAYER | GUESS | DIFFERENCE | POINTS GAINED | TOTAL POINTS\n" + + "__PLAYER | GUESS | DIFFERENCE | POINTS GAINED | TOTAL POINTS__\n" ) pitch_value = await self.update_pitch_value()