Browse Source

added destroy()

Dave Schuyler 22 years ago
parent
commit
350c151f87

+ 1 - 1
direct/src/level/DistributedInteractiveEntity.py

@@ -51,7 +51,7 @@ class DistributedInteractiveEntity(DistributedEntity.DistributedEntity):
         """
         """
         assert(self.debugPrint("generate()"))
         assert(self.debugPrint("generate()"))
         DistributedEntity.DistributedEntity.generate(self)
         DistributedEntity.DistributedEntity.generate(self)
-    
+
     def disable(self):
     def disable(self):
         assert(self.debugPrint("disable()"))
         assert(self.debugPrint("disable()"))
         # Go to the off state when the object is put in the cache
         # Go to the off state when the object is put in the cache

+ 10 - 1
direct/src/level/LogicGateAI.py

@@ -90,6 +90,15 @@ class LogicGateAI(Entity.Entity, PandaObject.PandaObject):
         self.setLogicType(self.logicType)
         self.setLogicType(self.logicType)
         self.setInput_input1_bool(self.input_input1_bool)
         self.setInput_input1_bool(self.input_input1_bool)
         self.setInput_input2_bool(self.input_input2_bool)
         self.setInput_input2_bool(self.input_input2_bool)
+
+    def destroy(self):
+        assert(self.debugPrint("destroy()"))
+        self.ignore(self.input1)
+        self.input1 = None
+        self.ignore(self.input2)
+        self.input2 = None
+        Entity.Entity.destroy(self)
+        PandaObject.PandaObject.destroy(self)
     
     
     def setLogicType(self, logicType):
     def setLogicType(self, logicType):
         assert(self.debugPrint("setLogicType(logicType=%s)"%(logicType,)))
         assert(self.debugPrint("setLogicType(logicType=%s)"%(logicType,)))
@@ -128,5 +137,5 @@ class LogicGateAI(Entity.Entity, PandaObject.PandaObject):
             self.accept(self.input2, self.setIsInput2)
             self.accept(self.input2, self.setIsInput2)
     
     
     def getName(self):
     def getName(self):
-        #return "orLoEntity-%s"%(self.entId,)
+        #return "logicGate-%s"%(self.entId,)
         return "switch-%s"%(self.entId,)
         return "switch-%s"%(self.entId,)