def enter(self, requestStatus): CogHQExterior.CogHQExterior.enter(self, requestStatus) for train in self.trains: train.show() # Load the CogHQ DNA file: dnaStore = DNAStorage() dnaFileName = self.genDNAFileName(self.zoneId) loadDNAFileAI(dnaStore, dnaFileName) # Collect all of the vis group zone IDs: self.zoneVisDict = {} for i in xrange(dnaStore.getNumDNAVisGroupsAI()): groupFullName = dnaStore.getDNAVisGroupName(i) visGroup = dnaStore.getDNAVisGroupAI(i) visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visibles = [] for i in xrange(visGroup.getNumVisibles()): visibles.append(int(visGroup.getVisible(i))) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles # Next, we want interest in all vis groups due to this being a Cog HQ: base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0])
def enter(self, requestStatus): self.zoneId = requestStatus['zoneId'] # Load the CogHQ DNA file: dnaStore = DNAStorage() dnaFileName = self.genDNAFileName(self.zoneId) if not dnaFileName.endswith('13200.pdna'): loadDNAFileAI(dnaStore, dnaFileName) # Collect all of the vis group zone IDs: self.zoneVisDict = {} for i in xrange(dnaStore.getNumDNAVisGroupsAI()): groupFullName = dnaStore.getDNAVisGroupName(i) visGroup = dnaStore.getDNAVisGroupAI(i) visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visibles = [] for i in xrange(visGroup.getNumVisibles()): visibles.append(int(visGroup.getVisible(i))) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles # Next, we want interest in all vis groups due to this being a Cog HQ: base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0]) BattlePlace.BattlePlace.enter(self) self.fsm.enterInitialState() base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) self.nodeList = [self.loader.geom] self.loader.hood.startSky() self._telemLimiter = TLGatherAllAvs('FactoryExterior', RotationLimitToH) self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) NametagGlobals.setMasterArrowsOn(1) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList) how = requestStatus['how'] self.fsm.request(how, [requestStatus])
def __init__(self, air, zoneId, canonicalHoodId): self.air = air self.zoneId = zoneId self.canonicalHoodId = canonicalHoodId self.fishingPonds = [] self.partyGates = [] self.treasurePlanner = None self.buildingManagers = [] self.suitPlanners = [] for zoneId in self.getZoneTable(): self.notify.info('Creating objects... ' + self.getLocationName(zoneId)) dnaFileName = self.air.lookupDNAFileName(zoneId) dnaStore = DNAStorage() dnaData = simbase.air.loadDNAFileAI(dnaStore, dnaFileName) self.air.dnaStoreMap[zoneId] = dnaStore self.air.dnaDataMap[zoneId] = dnaData