瀏覽代碼

define more accessors

David Rose 22 年之前
父節點
當前提交
f255fd3291
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. 15 0
      direct/src/distributed/DistributedObject.py

+ 15 - 0
direct/src/distributed/DistributedObject.py

@@ -244,6 +244,21 @@ class DistributedObject(PandaObject):
 
 
         return context
         return context
 
 
+    def getCurrentContexts(self):
+        # Returns a list of the currently outstanding contexts created
+        # by getCallbackContext().
+        return self.__callbacks.keys()
+
+    def getCallback(self, context):
+        # Returns the callback that was passed in to the previous
+        # call to getCallbackContext.
+        return self.__callbacks[context][0]
+
+    def getCallbackArgs(self, context):
+        # Returns the extraArgs that were passed in to the previous
+        # call to getCallbackContext.
+        return self.__callbacks[context][1]
+
     def doCallbackContext(self, context, args):
     def doCallbackContext(self, context, args):
         # This is called after the AI has responded to the message
         # This is called after the AI has responded to the message
         # sent via getCallbackContext(), above.  The context number is
         # sent via getCallbackContext(), above.  The context number is