diff options
-rw-r--r-- | swiftstory/game_manager.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/swiftstory/game_manager.py b/swiftstory/game_manager.py index 7551ac4..da2e5c7 100644 --- a/swiftstory/game_manager.py +++ b/swiftstory/game_manager.py @@ -21,13 +21,17 @@ class GameManager: def __init__(self) -> None: self.lang_containers: Dict[str, LangContainer] = {} - for language in next(os.walk('usr/share/swiftstory/lang'))[1]: + for language in self.list_languages(): self.lang_containers[language] = LangContainer( black_cards=Cards.get_black_cards(language), white_cards=Cards.get_white_cards(language), games={} ) + def list_languages(self) -> List[str]: + """ List available languages based on FS. """ + return next(os.walk("usr/share/swiftstory/lang"))[1] + def join_game(self, game_name: str, lang: str) -> Game: container = self.lang_containers.get(lang) if container is None: |