Browse Source

Ant is transportable. It must have type

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

+ 1 - 0
intelligine/cst.py View File

@@ -24,6 +24,7 @@ MOVE_MODE_NURSE = IncrementedNamedInt.get('intelligine.basebug.move.mode.nurse')
24 24
 TYPE = IncrementedNamedInt.get('intelligine.object.type')
25 25
 TYPE_RESOURCE_TRANSFORMABLE = IncrementedNamedInt.get('intelligine.object.type.resource.transformable')
26 26
 TYPE_NURSERY = IncrementedNamedInt.get('intelligine.object.type.nursery')
27
+TYPE_ANT = IncrementedNamedInt.get('intelligine.object.type.ant')
27 28
 
28 29
 PHEROMON_POSITIONS = IncrementedNamedInt.get('intelligine.phero.positions')
29 30
 PHEROMON_INFOS = IncrementedNamedInt.get('intelligine.phero.infos')

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

@@ -1,7 +1,7 @@
1 1
 from intelligine.core.exceptions import PheromoneException
2 2
 from intelligine.synergy.object.Bug import Bug
3 3
 from intelligine.cst import CARRYING, TRANSPORTER, ATTACKER, COL_TRANSPORTER, COL_TRANSPORTER_NOT_CARRYING, \
4
-    COL_FIGHTER, MOVE_MODE_EXPLO, MOVE_MODE_GOHOME, CARRIED, BODY_PART_PHEROMONE_GLAND
4
+    COL_FIGHTER, MOVE_MODE_EXPLO, MOVE_MODE_GOHOME, CARRIED, BODY_PART_PHEROMONE_GLAND, TYPE, TYPE_ANT
5 5
 from intelligine.synergy.object.Food import Food
6 6
 from intelligine.simulation.object.pheromone.MovementPheromoneGland import MovementPheromoneGland
7 7
 from intelligine.simulation.object.brain.AntBrain import AntBrain
@@ -21,6 +21,7 @@ class Ant(Bug):
21 21
                                                            COL_FIGHTER])
22 22
         self._carried = None
23 23
         self._brain.switch_to_mode(MOVE_MODE_EXPLO)
24
+        context.metas.list.add(TYPE, self.get_id(), TYPE_ANT)
24 25
 
25 26
     def _get_brain_instance(self):
26 27
         return AntBrain(self._context, self)