summaryrefslogtreecommitdiff
path: root/CAO_GameManager.py
blob: a3a12e5140526bca897f1207bbd601d52b80dc4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from CAO_Game import CAO_Game
from CAO_Cards import CAO_Cards

class CAO_GameManager():
    def __init__(self):
        self.games = {}

        self.black_cards = CAO_Cards.get_black_cards()
        self.white_cards = CAO_Cards.get_white_cards()

    def join_game(self, game_name):
        game = self.games.get(game_name)

        if game is None:
            print('Starting new game')
            game = self.games[game_name] = CAO_Game(self.white_cards, self.black_cards)

        return game