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
 TYPE = IncrementedNamedInt.get('intelligine.object.type')
24
 TYPE = IncrementedNamedInt.get('intelligine.object.type')
25
 TYPE_RESOURCE_TRANSFORMABLE = IncrementedNamedInt.get('intelligine.object.type.resource.transformable')
25
 TYPE_RESOURCE_TRANSFORMABLE = IncrementedNamedInt.get('intelligine.object.type.resource.transformable')
26
 TYPE_NURSERY = IncrementedNamedInt.get('intelligine.object.type.nursery')
26
 TYPE_NURSERY = IncrementedNamedInt.get('intelligine.object.type.nursery')
27
+TYPE_ANT = IncrementedNamedInt.get('intelligine.object.type.ant')
27
 
28
 
28
 PHEROMON_POSITIONS = IncrementedNamedInt.get('intelligine.phero.positions')
29
 PHEROMON_POSITIONS = IncrementedNamedInt.get('intelligine.phero.positions')
29
 PHEROMON_INFOS = IncrementedNamedInt.get('intelligine.phero.infos')
30
 PHEROMON_INFOS = IncrementedNamedInt.get('intelligine.phero.infos')

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

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