コード例 #1
0
 def generate(self):
     self.notify.debug('generate %s: room=%s' % (self.doId, self.roomId))
     self.notify.debug('loading spec')
     specModule = BoardOfficeRoomSpecs.getBoardOfficeRoomSpecModule(
         self.roomId)
     roomSpec = LevelSpec.LevelSpec(specModule)
     if __dev__:
         self.notify.debug('creating entity type registry')
         typeReg = self.getBoardOfficeEntityTypeReg()
         roomSpec.setEntityTypeReg(typeReg)
     self.notify.debug('creating entities')
     DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec)
     self.notify.debug('creating cogs')
     cogSpecModule = BoardOfficeRoomSpecs.getCogSpecModule(self.roomId)
     self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
         self.air,
         self,
         DistributedBoardOfficeSuitAI.DistributedBoardOfficeSuitAI,
         DistributedBoardOfficeBattleAI.DistributedBoardOfficeBattleAI,
         cogSpecModule.CogData,
         cogSpecModule.ReserveCogData,
         cogSpecModule.BattleCells,
         battleExpAggreg=self.battleExpAggreg)
     suitHandles = self.planner.genSuits()
     messenger.send('plannerCreated-' + str(self.doId))
     self.suits = suitHandles['activeSuits']
     self.reserveSuits = suitHandles['reserveSuits']
     self.d_setSuits()
     self.notify.debug('finish boardoffice room %s %s creation' %
                       (self.roomId, self.doId))
コード例 #2
0
 def levelAnnounceGenerate(self):
     self.notify.debug('levelAnnounceGenerate')
     DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
     specModule = BoardOfficeRoomSpecs.getBoardOfficeRoomSpecModule(
         self.roomId)
     roomSpec = LevelSpec.LevelSpec(specModule)
     if __dev__:
         typeReg = self.getEntityTypeReg()
         roomSpec.setEntityTypeReg(typeReg)
     DistributedLevel.DistributedLevel.initializeLevel(self, roomSpec)