summaryrefslogtreecommitdiff
path: root/swiftstory/GameManager.py
diff options
context:
space:
mode:
Diffstat (limited to 'swiftstory/GameManager.py')
-rw-r--r--swiftstory/GameManager.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/swiftstory/GameManager.py b/swiftstory/GameManager.py
deleted file mode 100644
index 52ce554..0000000
--- a/swiftstory/GameManager.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import logging
-import os
-
-from swiftstory.exception import UnsupportedLanguage
-from swiftstory.Game import Game
-from swiftstory.Cards import Cards
-
-
-class GameManager:
- def __init__(self):
- self.langs = {}
-
- for filename in next(os.walk('usr/share/swiftstory/lang'))[1]:
- self.langs[filename] = {}
-
- for lang in self.langs:
- self.langs[lang]['black_cards'] = Cards.get_black_cards(lang)
- self.langs[lang]['white_cards'] = Cards.get_white_cards(lang)
-
- self.langs[lang]['games'] = {}
-
- def join_game(self, game_name, lang):
- if self.langs.get(lang) is None:
- raise UnsupportedLanguage(lang)
-
- games = self.langs[lang]['games']
- black_cards = self.langs[lang]['black_cards']
- white_cards = self.langs[lang]['white_cards']
-
- game = games.get(game_name)
-
- if game is None:
- logging.info("Starting new game: %s (lang: %s)", game_name, lang)
-
- game = games[game_name] = Game(white_cards, black_cards)
-
- return game