better return type

This commit is contained in:
Maximilian Keßler 2023-08-08 14:06:44 +02:00
parent 3ffdfc10a5
commit 511c3bc7c6
Signed by: max
GPG key ID: BCC5A619923C0BA5
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
[project] [project]
name = "hanabi" name = "hanabi"
version = "1.1.4" version = "1.1.5"
description = "Hanabi interface" description = "Hanabi interface"
readme = "README.md" readme = "README.md"
license = { file = "LICENSE" } license = { file = "LICENSE" }

View file

@ -177,7 +177,7 @@ def compress_game_state(state: Union[hanab_game.GameState, hanab_live.HanabLiveG
return with_dashes return with_dashes
def decompress_game_state(game_str: str) -> hanab_game.GameState: def decompress_game_state(game_str: str) -> hanab_live.HanabLiveGameState:
game_str = game_str.replace("-", "") game_str = game_str.replace("-", "")
parts = game_str.split(",") parts = game_str.split(",")
if not len(parts) == 3: if not len(parts) == 3:
@ -211,8 +211,8 @@ def decompress_game_state(game_str: str) -> hanab_game.GameState:
except ValueError: except ValueError:
raise ValueError("Expected variant id, found: {}".format(variant_id)) raise ValueError("Expected variant id, found: {}".format(variant_id))
instance = hanab_game.HanabiInstance(deck, num_players) instance = hanab_live.HanabLiveInstance(deck, num_players, variant_id)
game = hanab_game.GameState(instance) game = hanab_live.HanabLiveGameState(instance)
# TODO: game is not in consistent state # TODO: game is not in consistent state
game.actions = actions game.actions = actions