本文整理汇总了Python中FactorySpecs.getFactorySpecModule方法的典型用法代码示例。如果您正苦于以下问题:Python FactorySpecs.getFactorySpecModule方法的具体用法?Python FactorySpecs.getFactorySpecModule怎么用?Python FactorySpecs.getFactorySpecModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FactorySpecs
的用法示例。
在下文中一共展示了FactorySpecs.getFactorySpecModule方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate
# 需要导入模块: import FactorySpecs [as 别名]
# 或者: from FactorySpecs import getFactorySpecModule [as 别名]
def generate(self):
self.notify.info('generate')
self.notify.info('start factory %s %s creation, frame=%s' % (self.factoryId, self.doId, globalClock.getFrameCount()))
if __dev__:
simbase.factory = self
self.notify.info('loading spec')
specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
factorySpec = LevelSpec.LevelSpec(specModule)
if __dev__:
self.notify.info('creating entity type registry')
typeReg = self.getEntityTypeReg()
factorySpec.setEntityTypeReg(typeReg)
self.notify.info('creating entities')
DistributedLevelAI.DistributedLevelAI.generate(self, factorySpec)
self.notify.info('creating cogs')
cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(self.air, self, DistributedFactorySuitAI.DistributedFactorySuitAI, DistributedBattleFactoryAI.DistributedBattleFactoryAI, cogSpecModule.CogData, cogSpecModule.ReserveCogData, cogSpecModule.BattleCells)
suitHandles = self.planner.genSuits()
messenger.send('plannerCreated-' + str(self.doId))
self.suits = suitHandles['activeSuits']
self.reserveSuits = suitHandles['reserveSuits']
self.d_setSuits()
scenario = 0
for avId in self.avIdList:
self.air.writeServerEvent('factory-entered', avId=avId, factoryId=self.factoryId, entranceId=self.entranceId, scenario=scenario, avIds=self.avIdList)
self.notify.info('finish factory %s %s creation' % (self.factoryId, self.doId))
示例2: levelAnnounceGenerate
# 需要导入模块: import FactorySpecs [as 别名]
# 或者: from FactorySpecs import getFactorySpecModule [as 别名]
def levelAnnounceGenerate(self):
self.notify.debug('levelAnnounceGenerate')
DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
factorySpec = LevelSpec.LevelSpec(specModule)
#if __dev__:
# typeReg = self.getEntityTypeReg()
# factorySpec.setEntityTypeReg(typeReg)
DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)
示例3: levelAnnounceGenerate
# 需要导入模块: import FactorySpecs [as 别名]
# 或者: from FactorySpecs import getFactorySpecModule [as 别名]
def levelAnnounceGenerate(self):
self.notify.debug("levelAnnounceGenerate")
DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
specModule = FactorySpecs.getFactorySpecModule(self.lawOfficeId)
factorySpec = LevelSpec.LevelSpec(specModule)
if __dev__:
typeReg = self.getEntityTypeReg()
factorySpec.setEntityTypeReg(typeReg)
DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)