PutableEvent.py 688B

12345678910111213
  1. from intelligine.synergy.event.transport.TakeableEvent import TakeableEvent
  2. from xyzworld.mechanism.ArroundMechanism import ArroundMechanism
  3. from intelligine.synergy.Simulation import Simulation
  4. from intelligine.cst import TRANSPORTER, ALIVE, CARRYING, CANT_PUT_STILL
  5. class PutableEvent(TakeableEvent):
  6. def concern(self, object_id, context):
  7. return context.metas.list.have(Simulation.STATE, object_id, TRANSPORTER) and \
  8. context.metas.list.have(Simulation.STATE, object_id, ALIVE) and \
  9. context.metas.list.have(Simulation.STATE, object_id, CARRYING) and \
  10. not context.metas.value.get(CANT_PUT_STILL, object_id, allow_empty=True)