DistributedObjectGlobalAI.py 1018 B

1234567891011121314151617181920212223242526272829303132
  1. from DistributedObjectAI import DistributedObjectAI
  2. from direct.directnotify.DirectNotifyGlobal import directNotify
  3. class DistributedObjectGlobalAI(DistributedObjectAI):
  4. notify = directNotify.newCategory('DistributedObjectGlobalAI')
  5. doNotDeallocateChannel = 1
  6. isGlobalDistObj = 1
  7. def __init__(self, air):
  8. DistributedObjectAI.__init__(self, air)
  9. def announceGenerate(self):
  10. DistributedObjectAI.announceGenerate(self)
  11. try:
  12. if not self.doNotListenToChannel:
  13. self.air.registerForChannel(self.doId)
  14. except AttributeError:
  15. self.air.registerForChannel(self.doId)
  16. return False
  17. def delete(self):
  18. DistributedObjectAI.delete(self)
  19. try:
  20. if not self.doNotListenToChannel:
  21. self.air.unregisterForChannel(self.doId)
  22. except AttributeError:
  23. self.air.unregisterForChannel(self.doId)
  24. ## self.air.removeDOFromTables(self)