Kaynağa Gözat

intelligine context

Bastien Sevajol 9 yıl önce
ebeveyn
işleme
6dcbe63e44
1 değiştirilmiş dosya ile 13 ekleme ve 0 silme
  1. 13 0
      intelligine/core/Context.py

+ 13 - 0
intelligine/core/Context.py Dosyayı Görüntüle

@@ -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