Browse Source

clean directions and imports

Bastien Sevajol 9 years ago
parent
commit
db9fa752db

+ 2 - 2
intelligine/simulation/object/brain/part/MoveBrainPart.py View File

@@ -27,12 +27,12 @@ class MoveBrainPart(BrainPart):
27 27
 
28 28
                 directions_list = directions_slighty[previous_direction]
29 29
                 # TODO: TMP tant que 1 niveau (z)
30
-                directions_list = [direction for direction in directions_list if direction > 9 and direction < 19]
30
+                directions_list = [direction for direction in directions_list if 9 < direction < 19]
31 31
                 direction_name = choice(directions_list)
32 32
             except KeyError:
33 33
                 pass
34 34
 
35 35
         if not direction_name:
36
-            direction_name = randint(directions_same_level[0], directions_same_level[1])
36
+            direction_name = randint(directions_same_level)
37 37
 
38 38
         return direction_name

+ 1 - 3
intelligine/simulation/pheromone/DirectionPheromone.py View File

@@ -1,6 +1,4 @@
1
-from collections import OrderedDict
2
-from intelligine.cst import PHEROMON_DIRECTION, PHEROMON_POSITIONS, MOVE_MODE_EXPLO, MOVE_MODE_GOHOME,\
3
-    PHEROMON_DIR_EXPLO, PHEROMON_DIR_HOME
1
+from intelligine.cst import PHEROMON_DIRECTION, PHEROMON_POSITIONS
4 2
 from intelligine.core.exceptions import NoPheromone
5 3
 from random import shuffle
6 4
 from xyzworld.geometry import get_degree_from_north

+ 1 - 5
intelligine/synergy/event/move/MoveAction.py View File

@@ -2,7 +2,7 @@ from synergine.synergy.event.Action import Action
2 2
 from intelligine.synergy.event.move.MoveEvent import MoveEvent
3 3
 from synergine.synergy.event.exception.ActionAborted import ActionAborted
4 4
 from xyzworld.cst import POSITION
5
-from intelligine.cst import PREVIOUS_DIRECTION, BLOCKED_SINCE, BRAIN_PART_MOVE, BRAIN_SCHEMA
5
+from intelligine.cst import BLOCKED_SINCE, BRAIN_PART_MOVE, BRAIN_SCHEMA
6 6
 from intelligine.synergy.event.move.direction import get_position_with_direction_decal
7 7
 
8 8
 
@@ -52,7 +52,3 @@ class MoveAction(Action):
52 52
 
53 53
         obj.set_position(self._move_to_point)
54 54
         obj.get_brain().get_part(BRAIN_PART_MOVE).done(obj, context)
55
-
56
-        # TODO: Ces metas update dans ant ?
57
-        context.metas.value.set(PREVIOUS_DIRECTION, self._object_id, self._move_to_direction)
58
-        context.metas.value.set(BLOCKED_SINCE, self._object_id, 0)

+ 4 - 4
intelligine/synergy/event/move/direction.py View File

@@ -13,10 +13,10 @@ niv 1:   19 20 21
13 13
          25 26 27
14 14
 """
15 15
 
16
-directions = (0, 27)
17
-directions_under_level = (0, 9)
18
-directions_same_level = (10, 18)
19
-directions_upper_level = (19, 27)
16
+directions = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27)
17
+directions_under_level = (1, 2, 3, 4, 5, 6, 7, 8, 9)
18
+directions_same_level = (10, 11, 12, 13, 15, 16, 17, 18)
19
+directions_upper_level = (19, 20, 21, 22, 23, 24, 25, 26, 27)
20 20
 directions_modifiers = {
21 21
   #  (z, x, y)
22 22
   1: (-1, -1, -1),