def enterToon(self): self.d_setState('toon') (exteriorZoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId() if simbase.config.GetBool( 'want-new-toonhall', 1) and ZoneUtil.getCanonicalZoneId(interiorZoneId) == ToonHall: self.interior = DistributedToonHallInteriorAI.DistributedToonHallInteriorAI( self.block, self.air, interiorZoneId, self) else: self.interior = DistributedToonInteriorAI.DistributedToonInteriorAI( self.block, self.air, interiorZoneId, self) self.interior.generateWithRequired(interiorZoneId) door = self.createExteriorDoor() insideDoor = DistributedDoorAI.DistributedDoorAI( self.air, self.block, DoorTypes.INT_STANDARD) door.setOtherDoor(insideDoor) insideDoor.setOtherDoor(door) door.zoneId = exteriorZoneId insideDoor.zoneId = interiorZoneId door.generateWithRequired(exteriorZoneId) insideDoor.generateWithRequired(interiorZoneId) self.door = door self.insideDoor = insideDoor self.becameSuitTime = 0 self.knockKnock = DistributedKnockKnockDoorAI.DistributedKnockKnockDoorAI( self.air, self.block) self.knockKnock.generateWithRequired(exteriorZoneId) self.air.writeServerEvent('building-toon', self.doId, '%s|%s' % (self.zoneId, self.block))
def enterToon(self): assert (self.debugPrint("enterToon()")) self.d_setState('toon') # Create the DistributedDoor: exteriorZoneId, interiorZoneId = self.getExteriorAndInteriorZoneId() # Toon interior: if simbase.config.GetBool("want-new-toonhall",1) and \ ZoneUtil.getCanonicalZoneId(interiorZoneId)== ToonHall: self.interior = DistributedToonHallInteriorAI.DistributedToonHallInteriorAI( self.block, self.air, interiorZoneId, self) else: self.interior = DistributedToonInteriorAI.DistributedToonInteriorAI( self.block, self.air, interiorZoneId, self) self.interior.generateWithRequired(interiorZoneId) # Outside door: door = self.createExteriorDoor() # Inside of the same door (different zone, and different distributed object): insideDoor = DistributedDoorAI.DistributedDoorAI( self.air, self.block, DoorTypes.INT_STANDARD) # Tell them about each other: door.setOtherDoor(insideDoor) insideDoor.setOtherDoor(door) door.zoneId = exteriorZoneId insideDoor.zoneId = interiorZoneId # Now that they both now about each other, generate them: door.generateWithRequired(exteriorZoneId) insideDoor.generateWithRequired(interiorZoneId) # keep track of them: self.door = door self.insideDoor = insideDoor self.becameSuitTime = 0 self.knockKnock = DistributedKnockKnockDoorAI.DistributedKnockKnockDoorAI( self.air, self.block) self.knockKnock.generateWithRequired(exteriorZoneId) self.air.writeServerEvent('building-toon', self.doId, "%s|%s" % (self.zoneId, self.block))