diff --git a/src/Engine.py b/src/Engine.py index 5230cb0..cec00f3 100644 --- a/src/Engine.py +++ b/src/Engine.py @@ -147,6 +147,9 @@ class Engine: goal_queue = PriorityQueue() + # sorting objects by distance to waiter + self.objects.sort(key=lambda o: o.distance_to(self.user.obj.position)) + for o in self.objects: condition = o.agent_role in [ diff --git a/src/obj/Object.py b/src/obj/Object.py index 4ada777..86eabc2 100644 --- a/src/obj/Object.py +++ b/src/obj/Object.py @@ -23,10 +23,13 @@ class Object: def get_angle(self): ''' - orientation = 0 -> up\n - orientation = 1 -> left\n - orientation = 2 -> down\n - orientation = 3 -> right\n + orientation = 0 -> up + + orientation = 1 -> left + + orientation = 2 -> down + + orientation = 3 -> right ''' return self.orientation * 90