瀏覽代碼

intelligine context

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