Browse Source

position instead trace

Bastien Sevajol 9 years ago
parent
commit
8c78f3388a

+ 2 - 2
socialintengine/synergy/ColonyConfiguration.py View File

@@ -10,9 +10,9 @@ class ColonyConfiguration(Configuration):
10 10
     def get_start_objects(self):
11 11
 
12 12
       ants = []
13
-      for i in range(20):
13
+      for i in range(10):
14 14
           ant = Ant()
15
-          ant.add_trace((0, 20, 20))
15
+          ant.set_position((0, 20, 20))
16 16
           metas.list.add(Simulation.STATE, ant.get_id(), ALIVE)
17 17
           ants.append(ant)
18 18
 

+ 21 - 4
socialintengine/synergy/RocksConfiguration.py View File

@@ -11,16 +11,33 @@ class RocksConfiguration(Configuration):
11 11
 
12 12
       rocks = []
13 13
 
14
-      for i in range(20):
14
+      for i in range(50):
15 15
           rock = Rock()
16 16
           metas.list.add(Simulation.STATE, rock.get_id(), IMPENETRABLE)
17
-          rock.add_trace((0, 10+i, 15))
17
+          rock.set_position((0, 0+i, 0))
18 18
           rocks.append(rock)
19 19
 
20
-      for i in range(20):
20
+      for i in range(50):
21 21
           rock = Rock()
22
-          rock.add_trace((0, 10+i, 25))
23 22
           metas.list.add(Simulation.STATE, rock.get_id(), IMPENETRABLE)
23
+          rock.set_position((0, 0+i, 50))
24 24
           rocks.append(rock)
25 25
 
26
+      for i in range(50):
27
+          rock = Rock()
28
+          rock.set_position((0, 0, 0+i))
29
+          metas.list.add(Simulation.STATE, rock.get_id(), IMPENETRABLE)
30
+          rocks.append(rock)
31
+
32
+      for i in range(50):
33
+          rock = Rock()
34
+          rock.set_position((0, 50, 0+i))
35
+          metas.list.add(Simulation.STATE, rock.get_id(), IMPENETRABLE)
36
+          rocks.append(rock)
37
+
38
+      rock = Rock()
39
+      rock.set_position((0, 50, 50))
40
+      metas.list.add(Simulation.STATE, rock.get_id(), IMPENETRABLE)
41
+      rocks.append(rock)
42
+
26 43
       return rocks

+ 3 - 1
socialintengine/synergy/event/move/MoveAction.py View File

@@ -40,6 +40,8 @@ class MoveAction(Action):
40 40
             try:
41 41
                 previous_direction = context.metas.value.get(PREVIOUS_DIRECTION, self._object_id)
42 42
                 directions_list = directions_slighty[previous_direction]
43
+                # TODO: TMP tant que 1 niveau (z)
44
+                directions_list = [direction for direction in directions_list if direction > 9 and direction < 19]
43 45
                 direction_name = choice(directions_list)
44 46
             except KeyError:
45 47
                 pass
@@ -58,7 +60,7 @@ class MoveAction(Action):
58 60
 
59 61
     def run(self, obj, collection, context):
60 62
         if self._move_to_point is not None:
61
-            obj.add_trace(self._move_to_point)
63
+            obj.set_position(self._move_to_point)
62 64
             context.metas.value.set(PREVIOUS_DIRECTION, self._object_id, self._move_to_direction)
63 65
             context.metas.value.set(BLOCKED_SINCE, self._object_id, 0)
64 66
         else: