From 37e5bd98f7e00271afa9135bbc8f7c96d0406422 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Thu, 4 Feb 2010 22:20:48 +0000 Subject: [PATCH] added doFindAllInstances --- direct/src/distributed/DoCollectionManager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/direct/src/distributed/DoCollectionManager.py b/direct/src/distributed/DoCollectionManager.py index c062766983..24db85d07c 100755 --- a/direct/src/distributed/DoCollectionManager.py +++ b/direct/src/distributed/DoCollectionManager.py @@ -91,6 +91,13 @@ class DoCollectionManager: matches.append(value) return matches, len(matches) + def doFindAllInstances(self, cls): + matches = [] + for value in self.doId2do.values(): + if isinstance(value, cls): + matches.append(value) + return matches + def _getDistanceFromLA(self, do): if hasattr(do, 'getPos'): return do.getPos(localAvatar).length()