def placeElevatorsOnMarkers(self):
     for room in self.rooms:
         if room.entType2ids['elevatorMarker']:
             for markerId in room.entType2ids['elevatorMarker']:
                 marker = room.getEntity(markerId)
                 newElevator = DistributedElevatorFloorAI.DistributedElevatorFloorAI(
                     self.air, self.doId, self, self.avIds, marker.doId)
                 newElevator.generateWithRequired(self.zoneId)
                 self.elevatorList.append(newElevator)
Ejemplo n.º 2
0
    def startOffice(self):
        #print("LOADING FIRST FLOOR!!!!! %s" % (self.currentFloor))

        # create our first floor
        self.notify.info('loading spec')
        specModule = self.layout.getFloorSpec(self.currentFloor)
        self.level = DistributedLawOfficeFloorAI.DistributedLawOfficeFloorAI(
            self.air, self.lawOfficeId, self.zoneId, self.entranceId,
            self.avIds, specModule)
        self.level.setLevelSpec(LevelSpec.LevelSpec(specModule))
        #self.currentFloorZone = self.air.allocateZone()

        self.notify.info('creating entities')
        self.level.generateWithRequired(self.zoneId)

        #print("STARTING TOONBARRIER FOR %s" % (self.avIds))
        #self.__barrier = ToonBarrier(
        #    'waitClientsFinishFloor',
        #    self.uniqueName('waitClientsFinishFloor'),
        #    self.avIds, 10000,
        #    self.startNextFloor, self.dumpEveryone)

        #Start: Add the connecting elevator--------------------

        #print("START SETTING UP ELEVATORS!!!")
        self.elevator = DistributedElevatorFloorAI.DistributedElevatorFloorAI(
            self.air, self.doId, self, self.avIds)
        #self.elevator.setLocked(0)
        self.elevator.setEntering(0)
        self.elevator.generateWithRequired(self.zoneId)
        self.elevatorB = DistributedElevatorFloorAI.DistributedElevatorFloorAI(
            self.air, self.doId, self, self.avIds)
        #self.elevatorB.setLocked(0)
        self.elevatorB.setEntering(1)
        self.elevatorB.generateWithRequired(self.zoneId)
        #self.unlockElevator()
        #self.elevator.unlock()
        #self.elevatorB.unlock()
        self.exchangeElevators()