Ejemplo n.º 1
0
    def createGolfGame(self, players):
        gameZone = self.air.allocateZone()

        course = DistributedGolfCourseAI(self.air)
        course.setGolferIds(players)
        course.setCourseId(self.index)
        course.zone = gameZone
        course.generateWithRequired(gameZone)

        return [gameZone, self.index]
 def createGolfGame(self, players):
     gameZone = self.air.allocateZone()
     
     course = DistributedGolfCourseAI(self.air)
     course.setGolferIds(players)
     course.setCourseId(self.index)
     course.zone = gameZone
     course.generateWithRequired(gameZone)
     
             
     return [gameZone, self.index]
    def trolleyLeft(self):
        numPlayers = self.countFullSeats()
        avIdList = []
        if numPlayers > 0:
            for seatIndex in range(len(self.seats)):
                avId = self.seats[seatIndex]
                if avId != None and avId != 0:
                    avIdList.append(avId)
                self.clearFullNow(seatIndex)

            golfZone = self.air.allocateZone()
            course = DistributedGolfCourseAI(golfZone, avIdList, self.golfCourse)
            course.generateWithRequired(golfZone)
            for avId in avIdList:
                if avId:
                    self.sendUpdateToAvatarId(avId, 'setGolfZone', [golfZone, 0])

        else:
            self.notify.warning('The trolley left, but was empty.')
        self.enter()
Ejemplo n.º 4
0
    def trolleyLeft(self):
        numPlayers = self.countFullSeats()
        avIdList = []
        if numPlayers > 0:
            for seatIndex in range(len(self.seats)):
                avId = self.seats[seatIndex]
                if avId != None and avId != 0:
                    avIdList.append(avId)
                self.clearFullNow(seatIndex)

            golfZone = self.air.allocateZone()
            course = DistributedGolfCourseAI(golfZone, avIdList,
                                             self.golfCourse)
            course.generateWithRequired(golfZone)
            for avId in avIdList:
                if avId:
                    self.sendUpdateToAvatarId(avId, 'setGolfZone',
                                              [golfZone, 0])

        else:
            self.notify.warning('The trolley left, but was empty.')
        self.enter()