Esempio n. 1
0
    def trolleyLeft(self):
        numPlayers = self.countFullSeats()

        avIdList = []
        # It is possible the players exited the district
        if (numPlayers > 0):
            for seatIndex in range(len(self.seats)):
                avId = self.seats[seatIndex]
                avIdList.append(avId)
                # Clear the fill slot
                self.clearFullNow(seatIndex)

            golfZone = GolfManagerAI.GolfManagerAI().readyGolfCourse(
                avIdList, self.golfCourse)
            for avId in avIdList:
                # Tell each player on the trolley that they should enter the
                # minigame now.
                if avId:
                    assert (avId > 0)
                    self.sendUpdateToAvatarId(avId, "setGolfZone",
                                              [golfZone, 0])
            #self.sendUpdateToAvatarId(avId, "setMinigameZone",
            #                          [minigameZone, minigameId])
        else:
            self.notify.warning("The trolley left, but was empty.")

        # Switch back into entering mode.
        self.enter()
 def trolleyLeft(self):
     numPlayers = self.countFullSeats()
     avIdList = []
     if numPlayers > 0:
         for seatIndex in xrange(len(self.seats)):
             avId = self.seats[seatIndex]
             avIdList.append(avId)
             self.clearFullNow(seatIndex)
         golfManager = GolfManagerAI.GolfManagerAI()
         golfZone = golfManager.readyGolfCourse(avIdList, self.golfCourse)
         for avId in avIdList:
             if avId:
                 self.sendUpdateToAvatarId(avId, 'setGolfZone', [golfZone, 0])
     else:
         self.notify.warning('The trolley left, but was empty.')
     self.enter()
 def delete(self):
     self.notify.debug('GOLF COURSE: delete: deleting AI GolfCourse object')
     if hasattr(self, 'rewardBarrier'):
         self.rewardBarrier.cleanup()
         del self.rewardBarrier
     if self.currentHole:
         self.notify.debug('calling requestDelete on hole %d' % self.currentHole.doId)
         self.currentHole.requestDelete()
         self.currentHole = None
     self.ignoreAll()
     from toontown.golf import GolfManagerAI
     GolfManagerAI.GolfManagerAI().removeCourse(self)
     if self.__barrier:
         self.__barrier.cleanup()
         self.__barrier = None
     DistributedObjectAI.DistributedObjectAI.delete(self)
Esempio n. 4
0
    def delete(self):
        self.notify.debug("GOLF COURSE: delete: deleting AI GolfCourse object")
        if hasattr(self, 'rewardBarrier'):
            self.rewardBarrier.cleanup()
            del self.rewardBarrier
        if self.currentHole:
            self.notify.debug('calling requestDelete on hole %d' %
                              self.currentHole.doId)
            self.currentHole.requestDelete()
            self.currentHole = None

        self.ignoreAll()
        # tell GolfManagerAI to remove us
        # TODO figure out why the import doesn't work at the top of the file
        from toontown.golf import GolfManagerAI
        GolfManagerAI.GolfManagerAI().removeCourse(self)
        if self.__barrier:
            self.__barrier.cleanup()
            self.__barrier = None
        DistributedObjectAI.DistributedObjectAI.delete(self)