Browse Source

intelligine context

Bastien Sevajol 9 years ago
parent
commit
6dcbe63e44
1 changed files with 13 additions and 0 deletions
  1. 13 0
      intelligine/core/Context.py

+ 13 - 0
intelligine/core/Context.py View File

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