added status

This commit is contained in:
Dave Schuyler 2005-06-17 02:23:30 +00:00
parent 0985f1d169
commit 3313716e05
2 changed files with 26 additions and 2 deletions

View File

@ -69,6 +69,19 @@ class DistributedObject(PandaObject):
#zone of the distributed object, default to 0 #zone of the distributed object, default to 0
self.zone = 0 self.zone = 0
if __debug__:
def status(self):
try:
print "doId is", self.doId
print "parentId is", self.parentId
print "zoneId is", self.zoneId
print "class name is", self.__class__.__name__
print "generated is", self.activeState == ESGenerated
print "disabled is", self.activeState < ESGenerating
print "neverDisable is", self.neverDisable
print "cacheable is", self.cacheable
except: pass
def setNeverDisable(self, bool): def setNeverDisable(self, bool):
assert((bool == 1) or (bool == 0)) assert((bool == 1) or (bool == 0))
self.neverDisable = bool self.neverDisable = bool

View File

@ -2,12 +2,12 @@
from direct.directnotify.DirectNotifyGlobal import * from direct.directnotify.DirectNotifyGlobal import *
from direct.showbase import PythonUtil from direct.showbase import PythonUtil
from direct.showbase import DirectObject from direct.showbase.DirectObject import DirectObject
from pandac.PandaModules import * from pandac.PandaModules import *
from PyDatagram import PyDatagram from PyDatagram import PyDatagram
from PyDatagramIterator import PyDatagramIterator from PyDatagramIterator import PyDatagramIterator
class DistributedObjectAI(DirectObject.DirectObject): class DistributedObjectAI(DirectObject):
notify = directNotify.newCategory("DistributedObjectAI") notify = directNotify.newCategory("DistributedObjectAI")
QuietZone = 1 QuietZone = 1
@ -47,6 +47,17 @@ class DistributedObjectAI(DirectObject.DirectObject):
# """ # """
# print ("Destructing: " + self.__class__.__name__) # print ("Destructing: " + self.__class__.__name__)
if __debug__:
def status(self):
try:
print "doId is", self.doId
print "parentId is", self.parentId
print "zoneId is", self.zoneId
print "class name is", self.__class__.__name__
print "isGenerated() is", self.isGenerated()
print "isDeleted() is", self.isDeleted()
except: pass
def getDeleteEvent(self): def getDeleteEvent(self):
# this is sent just before we get deleted # this is sent just before we get deleted
if hasattr(self, 'doId'): if hasattr(self, 'doId'):