DANIEL: GSHoodAI cleanup

This commit is contained in:
John 2015-06-10 21:38:35 +03:00 committed by Loudrob
parent 887fa8abda
commit 4b2e373e45

View file

@ -27,17 +27,14 @@ class GSHoodAI(HoodAI.HoodAI):
HoodAI.HoodAI.startup(self) HoodAI.HoodAI.startup(self)
self.createStartingBlocks() self.createStartingBlocks()
self.cycleDuration = 10
self.createLeaderBoards() self.createLeaderBoards()
self.__cycleLeaderBoards()
def shutdown(self): def shutdown(self):
HoodAI.HoodAI.shutdown(self) HoodAI.HoodAI.shutdown(self)
taskMgr.removeTasksMatching(str(self) + '_leaderBoardSwitch') taskMgr.removeTasksMatching('leaderBoardSwitch')
for board in self.leaderBoards: for board in self.leaderBoards:
board.delete() board.delete()
del self.leaderBoards del self.leaderBoards
def findRacingPads(self, dnaGroup, zoneId, area, padType='racing_pad'): def findRacingPads(self, dnaGroup, zoneId, area, padType='racing_pad'):
@ -154,8 +151,4 @@ class GSHoodAI(HoodAI.HoodAI):
self.leaderBoards = [] self.leaderBoards = []
dnaData = self.air.dnaDataMap[self.zoneId] dnaData = self.air.dnaDataMap[self.zoneId]
if dnaData.getName() == 'root': if dnaData.getName() == 'root':
self.leaderBoards = self.findLeaderBoards(dnaData, self.zoneId) self.leaderBoards = self.findLeaderBoards(dnaData, self.zoneId)
def __cycleLeaderBoards(self, task = None):
messenger.send('GS_LeaderBoardSwap' + str(self.zoneId))
taskMgr.doMethodLater(self.cycleDuration, self.__cycleLeaderBoards, str(self) + '_leaderBoardSwitch')