def createGame(self):
     self.canCall = False
     self.tileSeed = None
     self.typeId = None
     self.cardId += 1
     for spot in self.pond.spots:
         avId = self.pond.spots[spot].avId
         request = RequestCard.get(avId)
         if request:
             self.typeId, self.tileSeed = request
             del RequestCard[avId]
     if self.cardId > 65535:
         self.cardId = 0
     if not self.tileSeed:
         self.tileSeed = random.randrange(0, 65535)
     if self.typeId == None:
         self.typeId = random.randrange(0, 4)
     if self.typeId == BingoGlobals.NORMAL_CARD:
         self.bingoCard = NormalBingo()
     elif self.typeId == BingoGlobals.DIAGONAL_CARD:
         self.bingoCard = DiagonalBingo()
     elif self.typeId == BingoGlobals.THREEWAY_CARD:
         self.bingoCard = ThreewayBingo()
     elif self.typeId == BingoGlobals.FOURCORNER_CARD:
         self.bingoCard = FourCornerBingo()
     else:
         self.bingoCard = BlockoutBingo()
     self.bingoCard.generateCard(self.tileSeed, self.pond.getArea())
     self.sendCardStateUpdate()
     self.b_setJackpot(BingoGlobals.getJackpot(self.typeId))
     self.state = 'Playing'
     self.sendStateUpdate()
     taskMgr.doMethodLater(BingoGlobals.getGameTime(self.typeId), DistributedPondBingoManagerAI.finishGame, 'finishGame%d' % self.getDoId(), [self])
Exemple #2
0
 def createGame(self):
     self.canCall = False
     self.tileSeed = None
     self.typeId = None
     self.cardId += 1
     for spot in self.pond.spots:
         avId = self.pond.spots[spot].avId
         request = RequestCard.get(avId)
         if request:
             self.typeId, self.tileSeed = request
             del RequestCard[avId]
     if self.cardId > 65535:
         self.cardId = 0
     if not self.tileSeed:
         self.tileSeed = random.randrange(0, 65535)
     if self.typeId == None:
         self.typeId = random.randrange(0, 4)
     if self.typeId == BingoGlobals.NORMAL_CARD:
         self.bingoCard = NormalBingo()
     elif self.typeId == BingoGlobals.DIAGONAL_CARD:
         self.bingoCard = DiagonalBingo()
     elif self.typeId == BingoGlobals.THREEWAY_CARD:
         self.bingoCard = ThreewayBingo()
     elif self.typeId == BingoGlobals.FOURCORNER_CARD:
         self.bingoCard = FourCornerBingo()
     else:
         self.bingoCard = BlockoutBingo()
     self.bingoCard.generateCard(self.tileSeed, self.pond.getArea())
     self.sendCardStateUpdate()
     self.b_setJackpot(BingoGlobals.getJackpot(self.typeId))
     self.state = 'Playing'
     self.sendStateUpdate()
     taskMgr.doMethodLater(BingoGlobals.getGameTime(self.typeId),
                           DistributedPondBingoManagerAI.finishGame,
                           'finishGame%d' % self.getDoId(), [self])
 def enterPlaying(self, timeStamp):
     self.notify.debug('enterPlaying: Enter Playing State')
     self.lastCatch = None
     session = BingoGlobals.getGameTime(self.typeId)
     time = session - globalClockDelta.localElapsedTime(timeStamp[0])
     self.card.startGameCountdown(time)
     self.card.enableCard(self.checkForUpdate)
     return
 def enterPlaying(self, timeStamp):
     self.notify.debug('enterPlaying: Enter Playing State')
     self.lastCatch = None
     session = BingoGlobals.getGameTime(self.typeId)
     time = session - globalClockDelta.localElapsedTime(timeStamp[0])
     self.card.startGameCountdown(time)
     self.card.enableCard(self.checkForUpdate)
     return