canAcceptEntity (checks if can accept specific entity) and haveToDisposeEntity...

canAcceptEntity (checks if can accept specific entity) and haveToDisposeEntity (returns the entity that the object will dispose) methods added to CoreObject
parent b355de42
...@@ -328,6 +328,14 @@ class CoreObject(Process): ...@@ -328,6 +328,14 @@ class CoreObject(Process):
activeObjectQueue=self.getActiveObjectQueue() activeObjectQueue=self.getActiveObjectQueue()
return len(activeObjectQueue)>0 return len(activeObjectQueue)>0
#========================================================================
# checks if the object can dispose an entity
# and returns the entity that it will dispose
#========================================================================
def haveToDisposeEntity(self, callerObject=None):
activeObjectQueue=self.getActiveObjectQueue()
if self.haveToDispose(callerObject):
return activeObjectQueue[0]
# ======================================================================= # =======================================================================
# checks if the Object can accept an entity and there is an entity # checks if the Object can accept an entity and there is an entity
# in some possible giver waiting for it # in some possible giver waiting for it
...@@ -341,6 +349,12 @@ class CoreObject(Process): ...@@ -341,6 +349,12 @@ class CoreObject(Process):
def canAccept(self, callerObject=None): def canAccept(self, callerObject=None):
pass pass
# =======================================================================
# checks if the object can accept an specific Entity
# =======================================================================
def canAcceptEntity(self, callerEntity=None):
return True
# ======================================================================= # =======================================================================
# sorts the Entities in the activeQ of the objects # sorts the Entities in the activeQ of the objects
# ======================================================================= # =======================================================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment