mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-06 03:44:00 -04:00
getDoList to getDoIdList; getPlayerAvatars
This commit is contained in:
parent
396b2ef8fb
commit
8e683fc75d
@ -1,6 +1,9 @@
|
|||||||
#hack:
|
#hack:
|
||||||
BAD_DO_ID = BAD_ZONE_ID = -1
|
BAD_DO_ID = BAD_ZONE_ID = -1
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
from otp.avatar.DistributedPlayerAI import DistributedPlayerAI
|
||||||
|
|
||||||
class DoCollectionManager:
|
class DoCollectionManager:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Dict of {DistributedObject ids : DistributedObjects}
|
# Dict of {DistributedObject ids : DistributedObjects}
|
||||||
@ -46,7 +49,7 @@ class DoCollectionManager:
|
|||||||
distObj.dclass.getName(),
|
distObj.dclass.getName(),
|
||||||
distObj.__dict__.get("name"))
|
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.
|
parentId is any distributed object id.
|
||||||
zoneId is a uint32, defaults to None (all zones). Try zone 2 if
|
zoneId is a uint32, defaults to None (all zones). Try zone 2 if
|
||||||
@ -77,6 +80,11 @@ class DoCollectionManager:
|
|||||||
r = a
|
r = a
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
def getPlayerAvatars(self):
|
||||||
|
return [i for i in simbase.air.doId2do.values()
|
||||||
|
if isinstance(i, DistributedPlayerAI)]
|
||||||
|
|
||||||
def countObjects(self, classType):
|
def countObjects(self, classType):
|
||||||
"""
|
"""
|
||||||
Counts the number of objects of the given type in the
|
Counts the number of objects of the given type in the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user