Commit ee443529 authored by Jérome Perrin's avatar Jérome Perrin

send a message to GUI each time an entity moves

parent 3d32e238
......@@ -197,6 +197,15 @@ class CoreObject(Process):
giverObjectQueue=self.getGiverObjectQueue()
# remove entity from the giver
activeEntity = giverObject.removeEntity(entity=self.identifyEntityToGet())
edge_id, edge_data = giverObject.edges_by_destination[self.id][0]
from Globals import send
send({"action": "move_entity",
"source": giverObject.id,
"destination": self.id,
"edge": edge_id,
"entity": activeEntity.id,
"time": now()})
# variable that holds the last giver; used in case of preemption
self.lastGiver=self.giver
#get the entity from the previous object and put it in front of the activeQ
......
......@@ -292,3 +292,9 @@ def updateGui(argumentDict={}):
import time
time.sleep(0.08)
def send(msg):
import Globals
Globals.ws.send(json.dumps(msg))
import time
time.sleep(0.02)
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