Skip to content

Commit

Permalink
autopep8
Browse files Browse the repository at this point in the history
  • Loading branch information
ezeluduena committed Nov 7, 2023
1 parent 2a7f7c4 commit 8b0fa1d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/routers/games/games.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ async def play_defense_card(game_name: str, defense_info: PlayDefenseInformation
async def the_thing_end_game(game_name: str, player_id: int):
utils.verify_player_is_the_thing(player_id, game_name)
services.finish_game_by_the_thing(game_name)

json_msg = {
"event": utils.Events.GAME_ENDED
}
Expand Down
10 changes: 4 additions & 6 deletions app/routers/games/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,21 +430,19 @@ def get_game_result(name: str) -> GameResult:
lambda p: p.rol == PlayerRol.THE_THING)[:]
losers = game.players.select(
lambda p: p.rol != PlayerRol.THE_THING)[:]

elif no_human_remains(game):
reason = "No queda ningún Humano en la partida."
winners = game.players.select(
lambda p: p.rol in [PlayerRol.THE_THING, PlayerRol.INFECTED])[:]
losers = game.players.select(
lambda p: p.rol == PlayerRol.ELIMINATED)[:]



#elif the_thing_declared_a_wrong_victory(game):

# elif the_thing_declared_a_wrong_victory(game):
else:
reason = '''La Cosa ha declarado una victoria equivocada. Todavia queda algún humano vivo.'''
winners = game.players.select(
lambda p: p.rol in [PlayerRol.HUMAN, PlayerRol.INFECTED])[:]
lambda p: p.rol == PlayerRol.HUMAN)[:]
losers = game.players.select(
lambda p: p.rol != PlayerRol.HUMAN)[:]

Expand Down
2 changes: 1 addition & 1 deletion app/routers/games/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def verify_player_is_the_thing(player_id, game_name):
status_code=status.HTTP_400_BAD_REQUEST,
detail=f"The player {player.name}, with id= {player.id} is not The Thing"
)


@db_session
def verify_game_can_be_finished(game: Game):
Expand Down

0 comments on commit 8b0fa1d

Please sign in to comment.