From 593c0836b69cbdc2368c4c77f9bb256d294a3c5c Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Fri, 26 Jan 2007 06:18:10 +0000 Subject: [PATCH] moved some code to base class, asserted some debugs --- direct/src/distributed/DistributedObject.py | 3 --- direct/src/distributed/DistributedObjectBase.py | 12 ++++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/direct/src/distributed/DistributedObject.py b/direct/src/distributed/DistributedObject.py index dbb727d1a9..fc57ce4124 100644 --- a/direct/src/distributed/DistributedObject.py +++ b/direct/src/distributed/DistributedObject.py @@ -131,9 +131,6 @@ class DistributedObject(DistributedObjectBase, EnforcesCalldowns): _getAutoInterests = None return list(autoInterests) - def hasParentingRules(self): - return self.dclass.getFieldByName('setParentingRules') != None - def setNeverDisable(self, bool): assert bool == 1 or bool == 0 self.neverDisable = bool diff --git a/direct/src/distributed/DistributedObjectBase.py b/direct/src/distributed/DistributedObjectBase.py index 920799b156..0f745eeae6 100755 --- a/direct/src/distributed/DistributedObjectBase.py +++ b/direct/src/distributed/DistributedObjectBase.py @@ -43,7 +43,7 @@ class DistributedObjectBase(DirectObject): return None def handleChildArrive(self, childObj, zoneId): - self.notify.debugCall() + assert self.notify.debugCall() # A new child has just setLocation beneath us. Give us a # chance to run code when a new child sets location to us. For # example, we may want to scene graph reparent the child to @@ -55,7 +55,7 @@ class DistributedObjectBase(DirectObject): pass def handleChildLeave(self, childObj, zoneId): - self.notify.debugCall() + assert self.notify.debugCall() # A child is about to setLocation away from us. Give us a # chance to run code just before a child sets location away from us. ## zone=self.children[zoneId] @@ -66,7 +66,15 @@ class DistributedObjectBase(DirectObject): # Inheritors should override pass + def handleQueryObjectChildrenLocalDone(self, context): + assert self.notify.debugCall() + # Inheritors should override + pass + def getParentObj(self): if self.parentId is None: return None return self.cr.doId2do.get(self.parentId) + + def hasParentingRules(self): + return self.dclass.getFieldByName('setParentingRules') != None