Esempio n. 1
0
    def removeRanksAbove(self, maxRankInDeck):
        done = False
        while not done:
            removedOne = False
            for cardValue in self.cards:
                tempCard = PlayingCardBase(cardValue)
                if tempCard.rank > maxRankInDeck:
                    self.cards.remove(cardValue)
                    removedOne = True

            if not removedOne:
                done = True
    def setGameReady(self):
        self.notify.debug('setGameReady')
        if self.OneCardInMultiplayer and len(self.avIdList) > 1:
            self.maxOpenCards = 1
        self.sendUpdate('setMaxOpenCards', [self.maxOpenCards])
        DistributedMinigameAI.setGameReady(self)
        for avId in self.avIdList:
            self.faceUpDict[avId] = []

        self.deck = PairingGameGlobals.createDeck(self.deckSeed,
                                                  self.numPlayers)
        for index in xrange(len(self.deck.cards)):
            cardValue = self.deck.cards[index]
            oneCard = PlayingCardBase(cardValue)
            self.cards.append(oneCard)
Esempio n. 3
0
    def setGameReady(self):
        self.notify.debug("setGameReady")

        # make sure we broadcast how many cards open per toon
        if self.OneCardInMultiplayer and len(self.avIdList) > 1:
            self.maxOpenCards = 1
        self.sendUpdate('setMaxOpenCards', [self.maxOpenCards])

        DistributedMinigameAI.setGameReady(self)
        # all of the players have checked in
        # they will now be shown the rules

        # init face up dict and other fields
        for avId in self.avIdList:
            self.faceUpDict[avId] = []
        self.deck = PairingGameGlobals.createDeck(self.deckSeed,
                                                  self.numPlayers)
        for index in range(len(self.deck.cards)):
            cardValue = self.deck.cards[index]
            oneCard = PlayingCardBase(cardValue)
            self.cards.append(oneCard)