From 542575544276cfb437252e3ebd84db763b7e268e Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Fri, 19 Dec 2003 21:19:40 +0000 Subject: [PATCH] added printZones() --- direct/src/level/LevelSpec.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/direct/src/level/LevelSpec.py b/direct/src/level/LevelSpec.py index e19c94d5ff..ba5c6f861d 100755 --- a/direct/src/level/LevelSpec.py +++ b/direct/src/level/LevelSpec.py @@ -139,6 +139,27 @@ class LevelSpec: def privGetScenarioEntityDict(self, scenario): return self.specDict['scenarios'][scenario][0] + def printZones(self): + """currently prints list of modelZoneNum->zone name""" + # this could be more efficient + allIds = self.getAllEntIds() + type2id = self.getEntType2ids(allIds) + zoneIds = type2id['zone'] + # omit the UberZone + if 0 in zoneIds: + zoneIds.remove(0) + # need to sort the zones by modelZoneNum + zoneNum2zoneId = {} + for id in zoneIds: + spec = self.getEntitySpec(id) + zoneNum2zoneId[spec['modelZoneNum']] = id + modelZoneNums = zoneNum2zoneId.keys() + modelZoneNums.sort() + for zoneNum in modelZoneNums: + id = zoneNum2zoneId[zoneNum] + spec = self.getEntitySpec(id) + print 'zone %s : %s' % (spec['modelZoneNum'], spec['name']) + if __dev__: def setLevel(self, level): self.level = level