소스 검색

fix ant default mode

Bastien Sevajol 8 년 전
부모
커밋
8bf9a21f0f
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      intelligine/simulation/object/brain/part/transport/AntPutBrainPart.py
  2. 1 0
      intelligine/synergy/object/ant/Ant.py

+ 3 - 1
intelligine/simulation/object/brain/part/transport/AntPutBrainPart.py 파일 보기

@@ -1,3 +1,4 @@
1
+from intelligine.synergy.object.Food import Food
1 2
 from synergine.core.Core import Core
2 3
 from intelligine.core.exceptions import CantFindWhereToPut
3 4
 from intelligine.cst import MODE_EXPLO, TYPE_RESOURCE_EXPLOITABLE, CARRIED, MODE_NURSE, TYPE_NURSERY, \
@@ -65,4 +66,5 @@ class AntPutBrainPart(TransportBrainPart):
65 66
 
66 67
     def done(self, puted_object):
67 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)

+ 1 - 0
intelligine/synergy/object/ant/Ant.py 파일 보기

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