diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2015-06-14 22:31:48 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-06-14 22:37:40 +0100 |
commit | 0fb08748e5285e5d4adc6135eec8889887a63299 (patch) | |
tree | 3a82c2899f33a8d4234b07799cff00865c8e141c /CAO_GameManager.py | |
parent | ad12c67adcc8e3c0f29814b1b95959ac4b9f4a4d (diff) |
use a python package instead of just modules
The package is contained in the CAO/ folder.
server.py is still at the root of the repository though.
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'CAO_GameManager.py')
-rw-r--r-- | CAO_GameManager.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/CAO_GameManager.py b/CAO_GameManager.py deleted file mode 100644 index 8c01547..0000000 --- a/CAO_GameManager.py +++ /dev/null @@ -1,34 +0,0 @@ -from CAO_Game import CAO_Game -from CAO_Cards import CAO_Cards - -import os - -class CAO_GameManager(): - def __init__(self): - self.langs = {} - - for filename in next(os.walk('lang'))[1]: - self.langs[filename] = {} - - for lang in self.langs: - self.langs[lang]['black_cards'] = CAO_Cards.get_black_cards(lang) - self.langs[lang]['white_cards'] = CAO_Cards.get_white_cards(lang) - - self.langs[lang]['games'] = {} - - def join_game(self, game_name, lang): - if self.langs.get(lang) is None: - return None - - 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: - print('Starting new game') - - game = games[game_name] = CAO_Game(white_cards, black_cards) - - return game |