Bastien Sevajol преди 9 години
родител
ревизия
6dcbe63e44
променени са 1 файла, в които са добавени 13 реда и са изтрити 0 реда
  1. 13 0
      intelligine/core/Context.py

+ 13 - 0
intelligine/core/Context.py Целия файл

@@ -0,0 +1,13 @@
1
+from xyzworld.Context import Context as XyzContext
2
+from intelligine.cst import IMPENETRABLE
3
+from xyzworld.cst import POSITIONS
4
+
5
+
6
+class Context(XyzContext):
7
+
8
+    def position_is_penetrable(self, position):
9
+        objects_ids_on_this_point = self.metas.list.get(POSITIONS, position, allow_empty=True)
10
+        for object_id_on_this_point in objects_ids_on_this_point:
11
+          if self.metas.states.have(object_id_on_this_point, IMPENETRABLE):
12
+            return False
13
+        return True