Browse Source

Add COL_TRANSPORTER

Bastien Sevajol 9 years ago
parent
commit
32e985aafd
3 changed files with 8 additions and 4 deletions
  1. 1 0
      intelligine/cst.py
  2. 3 2
      intelligine/synergy/Simulation.py
  3. 4 2
      intelligine/synergy/object/ant/Ant.py

+ 1 - 0
intelligine/cst.py View File

@@ -18,5 +18,6 @@ ACTION_DIE = IncrementedNamedInt.get('intelligine.basebug.action.die')
18 18
 COL_ALIVE = IncrementedNamedInt.get('intelligine.col.alive')
19 19
 COL_WALKER = IncrementedNamedInt.get('intelligine.col.walker')
20 20
 COL_FIGHTER = IncrementedNamedInt.get('intelligine.col.walker')
21
+COL_TRANSPORTER = IncrementedNamedInt.get('intelligine.col.transporter')
21 22
 COL_TRANSPORTER_CARRYING = IncrementedNamedInt.get('intelligine.col.transporter_carrying')
22 23
 COL_TRANSPORTER_NOT_CARRYING = IncrementedNamedInt.get('intelligine.col.transporter_not_carrying')

+ 3 - 2
intelligine/synergy/Simulation.py View File

@@ -5,7 +5,7 @@ from intelligine.synergy.event.transport.PutableAction import PutableAction
5 5
 from intelligine.synergy.event.transport.TakeableAction import TakeableAction
6 6
 from intelligine.synergy.event.move.MoveAction import MoveAction
7 7
 from intelligine.synergy.event.CycleAction import CycleAction
8
-from intelligine.cst import COL_TRANSPORTER_CARRYING, COL_TRANSPORTER_NOT_CARRYING, \
8
+from intelligine.cst import COL_TRANSPORTER_CARRYING, COL_TRANSPORTER_NOT_CARRYING, COL_TRANSPORTER, \
9 9
     COL_WALKER, ACTION_DIE, COL_ALIVE, ALIVE, ATTACKABLE
10 10
 
11 11
 
@@ -14,7 +14,8 @@ class Simulation(BaseSimulation):
14 14
     @staticmethod
15 15
     def event_bug_die(bug, context):
16 16
         context.metas.collections.remove_list(bug.get_id(),
17
-                                              [COL_TRANSPORTER_CARRYING, \
17
+                                              [COL_TRANSPORTER, \
18
+                                               COL_TRANSPORTER_CARRYING, \
18 19
                                                COL_TRANSPORTER_NOT_CARRYING, \
19 20
                                                COL_WALKER, \
20 21
                                                COL_ALIVE],

+ 4 - 2
intelligine/synergy/object/ant/Ant.py View File

@@ -1,6 +1,6 @@
1 1
 from intelligine.synergy.object.Bug import Bug
2 2
 from intelligine.cst import CARRYING, TRANSPORTER, ATTACKER, \
3
-    COL_TRANSPORTER_NOT_CARRYING, COL_FIGHTER
3
+   COL_TRANSPORTER, COL_TRANSPORTER_NOT_CARRYING, COL_FIGHTER
4 4
 
5 5
 
6 6
 class Ant(Bug):
@@ -8,7 +8,9 @@ class Ant(Bug):
8 8
     def __init__(self, collection, context):
9 9
         super().__init__(collection, context)
10 10
         context.metas.states.add_list(self.get_id(), [TRANSPORTER, ATTACKER])
11
-        context.metas.collections.add_list(self.get_id(), [COL_TRANSPORTER_NOT_CARRYING, COL_FIGHTER])
11
+        context.metas.collections.add_list(self.get_id(), [COL_TRANSPORTER,
12
+                                                           COL_TRANSPORTER_NOT_CARRYING,
13
+                                                           COL_FIGHTER])
12 14
         self._carried = []
13 15
 
14 16
     def put_carry(self, obj, position=None):