Esempio n. 1
0
    def generate(self):
        self.notify.debug('generate %s: room=%s' % (self.doId, self.roomId))
        self.notify.debug('loading spec')
        specModule = StageRoomSpecs.getStageRoomSpecModule(self.roomId)
        roomSpec = LevelSpec.LevelSpec(specModule)
        if __dev__:
            self.notify.debug('creating entity type registry')
            typeReg = self.getStageEntityTypeReg()
            roomSpec.setEntityTypeReg(typeReg)

        self.notify.debug('creating entities')
        DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec)
        self.notify.debug('creating cogs')
        cogSpecModule = StageRoomSpecs.getCogSpecModule(self.roomId)
        self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
            self.air,
            self,
            DistributedStageSuitAI.DistributedStageSuitAI,
            DistributedStageBattleAI.DistributedStageBattleAI,
            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 stage room %s %s creation' %
                          (self.roomId, self.doId))
 def generate(self):
     self.notify.debug("generate %s: room=%s" % (self.doId, self.roomId))
     self.notify.debug("loading spec")
     specModule = StageRoomSpecs.getStageRoomSpecModule(self.roomId)
     roomSpec = LevelSpec.LevelSpec(specModule)
     self.notify.debug("creating entities")
     DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec)
     self.notify.debug("creating cogs")
     cogSpecModule = StageRoomSpecs.getCogSpecModule(self.roomId)
     self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
         self.air,
         self,
         DistributedStageSuitAI.DistributedStageSuitAI,
         DistributedStageBattleAI.DistributedStageBattleAI,
         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 stage room %s %s creation" % (self.roomId, self.doId))
 def levelAnnounceGenerate(self):
     self.notify.debug('levelAnnounceGenerate')
     DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
     specModule = StageRoomSpecs.getStageRoomSpecModule(self.roomId)
     roomSpec = LevelSpec.LevelSpec(specModule)
     if __dev__:
         typeReg = self.getEntityTypeReg()
         roomSpec.setEntityTypeReg(typeReg)
     DistributedLevel.DistributedLevel.initializeLevel(self, roomSpec)
Esempio n. 4
0
    def generate(self):
        self.notify.debug('generate %s: room=%s' % (self.doId, self.roomId))

        # create our spec
        self.notify.debug('loading spec')
        specModule = StageRoomSpecs.getStageRoomSpecModule(self.roomId)
        roomSpec = LevelSpec.LevelSpec(specModule)

        if __dev__:
            # create a factory EntityTypeRegistry and hand it to the spec
            self.notify.debug('creating entity type registry')
            typeReg = self.getStageEntityTypeReg()
            roomSpec.setEntityTypeReg(typeReg)

        self.notify.debug('creating entities')
        DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec)

        # TODO: convert suits into Entities
        # create the suits
        # Until they are converted to entities, it's important that
        # the suits are created in the levelZone.

        self.notify.debug('creating cogs')
        cogSpecModule = StageRoomSpecs.getCogSpecModule(self.roomId)
        self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
            self.air,
            self,
            DistributedStageSuitAI.DistributedStageSuitAI,
            DistributedStageBattleAI.DistributedStageBattleAI,
            cogSpecModule.CogData,
            cogSpecModule.ReserveCogData,
            cogSpecModule.BattleCells,
            battleExpAggreg=self.battleExpAggreg)
        suitHandles = self.planner.genSuits()
        # alert battle blockers that planner has been created
        messenger.send("plannerCreated-" + str(self.doId))

        self.suits = suitHandles['activeSuits']
        self.reserveSuits = suitHandles['reserveSuits']
        self.d_setSuits()

        self.notify.debug('finish stage room %s %s creation' %
                          (self.roomId, self.doId))
 def generate(self):
     self.notify.debug('generate %s: room=%s' % (self.doId, self.roomId))
     self.notify.debug('loading spec')
     specModule = StageRoomSpecs.getStageRoomSpecModule(self.roomId)
     roomSpec = LevelSpec.LevelSpec(specModule)
     if __dev__:
         self.notify.debug('creating entity type registry')
         typeReg = self.getStageEntityTypeReg()
         roomSpec.setEntityTypeReg(typeReg)
     self.notify.debug('creating entities')
     DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec)
     self.notify.debug('creating cogs')
     cogSpecModule = StageRoomSpecs.getCogSpecModule(self.roomId)
     self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(self.air, self, DistributedStageSuitAI.DistributedStageSuitAI, DistributedStageBattleAI.DistributedStageBattleAI, 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 stage room %s %s creation' % (self.roomId, self.doId))