From abd089f9d2213cb1cba72e9dc4dc24d1288a0f77 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Fri, 20 Jan 2006 01:42:10 +0000 Subject: [PATCH] callback with do --- direct/src/distributed/DoCollectionManager.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/direct/src/distributed/DoCollectionManager.py b/direct/src/distributed/DoCollectionManager.py index 3bbc75d1f5..06116a7620 100755 --- a/direct/src/distributed/DoCollectionManager.py +++ b/direct/src/distributed/DoCollectionManager.py @@ -18,10 +18,26 @@ class DoCollectionManager: def getDo(self, doId): return self.doId2do.get(doId) + + def callbackWithDo(self, doId, callback): + do = self.doId2do.get(doId) + if do is not None: + callback(do) + else: + relatedObjectMgr(doId, allCallback=callback) + def getOwnerView(self, doId): assert self.hasOwnerView() return self.doId2ownerView.get(doId) + def callbackWithOwnerView(self, doId, callback): + assert self.hasOwnerView() + do = self.doId2ownerView.get(doId) + if do is not None: + callback(do) + else: + pass #relatedObjectMgr(doId, allCallback=callback) + def getDoTable(self, ownerView): if ownerView: assert self.hasOwnerView()