瀏覽代碼

removed air from AI entity constructor param list

Darren Ranalli 22 年之前
父節點
當前提交
21135f8573

+ 2 - 2
direct/src/level/DistributedEntityAI.py

@@ -7,8 +7,8 @@ class DistributedEntityAI(DistributedObjectAI.DistributedObjectAI,
     notify = DirectNotifyGlobal.directNotify.newCategory(
     notify = DirectNotifyGlobal.directNotify.newCategory(
         'DistributedEntityAI')
         'DistributedEntityAI')
 
 
-    def __init__(self, air, level, entId):
-        DistributedObjectAI.DistributedObjectAI.__init__(self, air)
+    def __init__(self, level, entId):
+        DistributedObjectAI.DistributedObjectAI.__init__(self, level.air)
         self.levelDoId = level.doId
         self.levelDoId = level.doId
         Entity.Entity.__init__(self, level, entId)
         Entity.Entity.__init__(self, level, entId)
 
 

+ 2 - 3
direct/src/level/DistributedInteractiveEntityAI.py

@@ -24,10 +24,9 @@ class DistributedInteractiveEntityAI(DistributedEntityAI.DistributedEntityAI):
     if __debug__:
     if __debug__:
         notify = DirectNotifyGlobal.directNotify.newCategory('DistributedInteractiveEntityAI')
         notify = DirectNotifyGlobal.directNotify.newCategory('DistributedInteractiveEntityAI')
 
 
-    def __init__(self, air, level, entId):
+    def __init__(self, level, entId):
         """entId: a unique identifier for this prop."""
         """entId: a unique identifier for this prop."""
-        DistributedEntityAI.DistributedEntityAI.__init__(self, air,
-                                                         level, entId)
+        DistributedEntityAI.DistributedEntityAI.__init__(self, level, entId)
         assert(self.debugPrint(
         assert(self.debugPrint(
                 "DistributedInteractiveEntityAI(entId=%s)"
                 "DistributedInteractiveEntityAI(entId=%s)"
                 %(entId)))
                 %(entId)))

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

@@ -51,7 +51,7 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI,
     def createEntityCreator(self):
     def createEntityCreator(self):
         """Create the object that will be used to create Entities.
         """Create the object that will be used to create Entities.
         Inheritors, override if desired."""
         Inheritors, override if desired."""
-        return EntityCreatorAI.EntityCreatorAI(self.air, level=self)
+        return EntityCreatorAI.EntityCreatorAI(level=self)
 
 
     def getEntityZoneId(self, entId):
     def getEntityZoneId(self, entId):
         """figure out what network zoneId an entity is in"""
         """figure out what network zoneId an entity is in"""

+ 7 - 8
direct/src/level/EntityCreatorAI.py

@@ -8,20 +8,20 @@ from PythonUtil import Functor
 
 
 # some useful constructor functions
 # some useful constructor functions
 # ctor functions for entities must take
 # ctor functions for entities must take
-#  (air, level, entId, zoneId)
+#  (level, entId, zoneId)
 
 
 # this func creates distributed entities whose constructors take
 # this func creates distributed entities whose constructors take
 #  (air, level doId, entId)
 #  (air, level doId, entId)
 # and do not generate themselves
 # and do not generate themselves
-def createDistributedEntity(AIclass, air, level, entId, zoneId):
+def createDistributedEntity(AIclass, level, entId, zoneId):
     """create a distributed entity and call generate"""
     """create a distributed entity and call generate"""
-    ent = AIclass(air, level, entId)
+    ent = AIclass(level, entId)
     ent.generateWithRequired(zoneId)
     ent.generateWithRequired(zoneId)
     return ent
     return ent
 
 
 # this func creates local entities whose constructors take
 # this func creates local entities whose constructors take
 #  (level, entId)
 #  (level, entId)
-def createLocalEntity(AIclass, air, level, entId, zoneId):
+def createLocalEntity(AIclass, level, entId, zoneId):
     """create a local entity"""
     """create a local entity"""
     ent = AIclass(level, entId)
     ent = AIclass(level, entId)
 
 
@@ -34,10 +34,9 @@ class EntityCreatorAI(EntityCreatorBase.EntityCreatorBase):
     """This class is responsible for creating instances of Entities on the AI.
     """This class is responsible for creating instances of Entities on the AI.
     It can be subclassed to handle more Entity types."""
     It can be subclassed to handle more Entity types."""
 
 
-    def __init__(self, air, level):
+    def __init__(self, level):
         EntityCreatorBase.EntityCreatorBase.__init__(self, level)
         EntityCreatorBase.EntityCreatorBase.__init__(self, level)
-        self.air = air
-
+        
         # create short aliases for ctor funcs
         # create short aliases for ctor funcs
         cLE = createLocalEntity
         cLE = createLocalEntity
 
 
@@ -51,4 +50,4 @@ class EntityCreatorAI(EntityCreatorBase.EntityCreatorBase):
     def doCreateEntity(self, ctor, entId):
     def doCreateEntity(self, ctor, entId):
         zoneId = self.level.getEntityZoneId(entId)
         zoneId = self.level.getEntityZoneId(entId)
         self.notify.debug('creating entity %s in zone %s' % (entId, zoneId))
         self.notify.debug('creating entity %s in zone %s' % (entId, zoneId))
-        return ctor(self.air, self.level, entId, zoneId)
+        return ctor(self.level, entId, zoneId)