|
@@ -1,9 +1,7 @@
|
1
|
1
|
from intelligine.core.exceptions import PheromoneException
|
2
|
2
|
from intelligine.synergy.object.Bug import Bug
|
3
|
|
-from intelligine.cst import CARRYING, TRANSPORTER, ATTACKER, \
|
4
|
|
- COL_TRANSPORTER, COL_TRANSPORTER_NOT_CARRYING, \
|
5
|
|
- COL_FIGHTER, MOVE_MODE_EXPLO, MOVE_MODE_GOHOME, \
|
6
|
|
- PHEROMON_DIR_EXPLO, CARRIED
|
|
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
|
7
|
5
|
from intelligine.synergy.object.Food import Food
|
8
|
6
|
from intelligine.simulation.object.pheromone.MovementPheromoneGland import MovementPheromoneGland
|
9
|
7
|
from intelligine.simulation.object.brain.AntBrain import AntBrain
|
|
@@ -11,6 +9,10 @@ from intelligine.simulation.object.brain.AntBrain import AntBrain
|
11
|
9
|
|
12
|
10
|
class Ant(Bug):
|
13
|
11
|
|
|
12
|
+ _body_parts = {
|
|
13
|
+ BODY_PART_PHEROMONE_GLAND: MovementPheromoneGland
|
|
14
|
+ }
|
|
15
|
+
|
14
|
16
|
def __init__(self, collection, context):
|
15
|
17
|
super().__init__(collection, context)
|
16
|
18
|
context.metas.states.add_list(self.get_id(), [TRANSPORTER, ATTACKER])
|
|
@@ -18,15 +20,13 @@ class Ant(Bug):
|
18
|
20
|
COL_TRANSPORTER_NOT_CARRYING,
|
19
|
21
|
COL_FIGHTER])
|
20
|
22
|
self._carried = None
|
21
|
|
- # TODO: Faire un body_part schema pour ces trucs la
|
22
|
|
- self._movement_pheromone_gland = MovementPheromoneGland(self, self._context)
|
23
|
23
|
self._brain.switch_to_mode(MOVE_MODE_EXPLO)
|
24
|
24
|
|
25
|
25
|
def _get_brain_instance(self):
|
26
|
26
|
return AntBrain(self._context, self)
|
27
|
27
|
|
28
|
28
|
def get_movement_pheromone_gland(self):
|
29
|
|
- return self._movement_pheromone_gland
|
|
29
|
+ return self.get_body_part(BODY_PART_PHEROMONE_GLAND)
|
30
|
30
|
|
31
|
31
|
def put_carry(self, obj, position=None):
|
32
|
32
|
if position is None:
|