From 8e683fc75dce021595f7ea99b024ea6c153cca2c Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Thu, 23 Jun 2005 23:33:55 +0000 Subject: [PATCH] getDoList to getDoIdList; getPlayerAvatars --- direct/src/distributed/DoCollectionManager.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/direct/src/distributed/DoCollectionManager.py b/direct/src/distributed/DoCollectionManager.py index b546e0d52e..1806220f08 100755 --- a/direct/src/distributed/DoCollectionManager.py +++ b/direct/src/distributed/DoCollectionManager.py @@ -1,6 +1,9 @@ #hack: BAD_DO_ID = BAD_ZONE_ID = -1 +if __debug__: + from otp.avatar.DistributedPlayerAI import DistributedPlayerAI + class DoCollectionManager: def __init__(self): # Dict of {DistributedObject ids : DistributedObjects} @@ -46,7 +49,7 @@ class DoCollectionManager: distObj.dclass.getName(), distObj.__dict__.get("name")) - def getDoList(self, parentId, zoneId=None, classType=None): + def getDoIdList(self, parentId, zoneId=None, classType=None): """ parentId is any distributed object id. zoneId is a uint32, defaults to None (all zones). Try zone 2 if @@ -77,6 +80,11 @@ class DoCollectionManager: r = a return r + if __debug__: + def getPlayerAvatars(self): + return [i for i in simbase.air.doId2do.values() + if isinstance(i, DistributedPlayerAI)] + def countObjects(self, classType): """ Counts the number of objects of the given type in the