Browse Source

fix to take egg

Bastien Sevajol 8 years ago
parent
commit
1ed2770230

+ 3 - 1
intelligine/simulation/object/brain/part/transport/AntPutBrainPart.py View File

1
+from intelligine.synergy.object.Food import Food
1
 from synergine.core.Core import Core
2
 from synergine.core.Core import Core
2
 from intelligine.core.exceptions import CantFindWhereToPut
3
 from intelligine.core.exceptions import CantFindWhereToPut
3
 from intelligine.cst import MODE_EXPLO, TYPE_RESOURCE_EXPLOITABLE, CARRIED, MODE_NURSE, TYPE_NURSERY, \
4
 from intelligine.cst import MODE_EXPLO, TYPE_RESOURCE_EXPLOITABLE, CARRIED, MODE_NURSE, TYPE_NURSERY, \
65
 
66
 
66
     def done(self, puted_object):
67
     def done(self, puted_object):
67
         # TODO: lancer le choix d'un nouveau mode dans le brain.
68
         # TODO: lancer le choix d'un nouveau mode dans le brain.
68
-        self._host.get_brain().switch_to_mode(MODE_EXPLO)
69
+        if isinstance(puted_object, Food):
70
+            self._host.get_brain().switch_to_mode(MODE_EXPLO)

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

22
                                                            COL_TRANSPORTER_NOT_CARRYING,
22
                                                            COL_TRANSPORTER_NOT_CARRYING,
23
                                                            COL_FIGHTER])
23
                                                            COL_FIGHTER])
24
         self._carried = None
24
         self._carried = None
25
-        self._brain.switch_to_mode(MODE_EXPLO)
25
+        #  TODO: Comme pour lorsque une action put est faite, lancer un algo de choix de la mission a suivre.
26
+        self._brain.switch_to_mode(MODE_NURSE)
26
         context.metas.list.add(TYPE, self.get_id(), TYPE_ANT)
27
         context.metas.list.add(TYPE, self.get_id(), TYPE_ANT)
27
 
28
 
28
     def die(self):
29
     def die(self):