From 0fb08748e5285e5d4adc6135eec8889887a63299 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 14 Jun 2015 22:31:48 +0100 Subject: 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 --- CAO_Board.py | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 CAO_Board.py (limited to 'CAO_Board.py') diff --git a/CAO_Board.py b/CAO_Board.py deleted file mode 100644 index 0fd595b..0000000 --- a/CAO_Board.py +++ /dev/null @@ -1,55 +0,0 @@ -import random - -class CAO_Board(): - def __init__(self, white_cards, black_cards): - self.white_pick = white_cards - self.black_pick = black_cards - - self.white_recycled = [] - self.black_recycled = [] - - self.current_black_card = None - - # tupple of cards / player currently being played - self.played_cards = [] - - random.shuffle(self.white_pick) - random.shuffle(self.black_pick) - - def reveal_black_card(self): - if not self.black_pick: - self.black_pick = self.black_recycle - - random.shuffle(self.black_pick) - - self.black_recycled = [] - - card = self.black_pick.pop() - - self.current_black_card = card - - def recycle_black_card(self): - self.black_recycled.append(self.current_black_card) - - def pick_white_card(self): - if not self.white_pick: - self.white_pick = self.white_recycled - - random.shuffle(self.white_pick) - - self.white_recycled = [] - - card = self.white_pick.pop() - - return card - - def play_card(self, player, card): - self.played_cards.append((card, player)) - - def shuffle_played_cards(self): - random.shuffle(self.played_cards) - - def recycle_played_cards(self): - self.white_recycled += [i[0] for i in self.played_cards] - - self.played_cards = [] -- cgit v1.2.3