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):
activeObjectQueue=self.getActiveObjectQueue()
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
# in some possible giver waiting for it
......@@ -341,6 +349,12 @@ class CoreObject(Process):
def canAccept(self, callerObject=None):
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
# =======================================================================
......
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