示例#1
0
文件: game.py 项目: jait/tupelo
    def _start_new_hand(self):
        """
        Start a new hand.
        """
        logging.info('New hand')
        self.state.tricks = [0, 0]

        # create a full deck
        deck = CardSet.new_full_deck()

        logging.debug('deck is %s', str(deck))
        deck.shuffle()
        logging.debug('shuffled deck %s', str(deck))

        deck.deal([player.hand for player in self.players])

        for player in self.players:
            player.hand.sort()
            logging.debug("%s's hand: %s", player.player_name,
                str(player.hand))

        # voting 
        self.state.mode = NOLO
        self.state.rami_chosen_by = None
        self._set_state(GameState.VOTING)

        # uncomment following to skip voting
        #self._set_state(GameState.ONGOING)
        # start the game
        self._next_in_turn(self.state.dealer + 1)
        self._signal_act()
示例#2
0
文件: players.py 项目: jait/tupelo
 def vote(self):
     """
     Vote for rami or nolo.
     """
     self.cards_left = CardSet.new_full_deck() - self.hand
     super(CountingBotPlayer, self).vote()