Browse Source

StockedFood & rename const

Bastien Sevajol 9 years ago
parent
commit
3bb8c4e3d9

+ 2 - 1
intelligine/cst.py View File

22
 MOVE_MODE_NURSE = IncrementedNamedInt.get('intelligine.basebug.move.mode.nurse')
22
 MOVE_MODE_NURSE = IncrementedNamedInt.get('intelligine.basebug.move.mode.nurse')
23
 
23
 
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_EXPLOITABLE = 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
 TYPE_ANT = IncrementedNamedInt.get('intelligine.object.type.ant')
28
 
28
 
39
 COL_TRANSPORTER = IncrementedNamedInt.get('intelligine.col.transporter')
39
 COL_TRANSPORTER = IncrementedNamedInt.get('intelligine.col.transporter')
40
 COL_TRANSPORTER_CARRYING = IncrementedNamedInt.get('intelligine.col.transporter_carrying')
40
 COL_TRANSPORTER_CARRYING = IncrementedNamedInt.get('intelligine.col.transporter_carrying')
41
 COL_TRANSPORTER_NOT_CARRYING = IncrementedNamedInt.get('intelligine.col.transporter_not_carrying')
41
 COL_TRANSPORTER_NOT_CARRYING = IncrementedNamedInt.get('intelligine.col.transporter_not_carrying')
42
+COL_EATABLE = IncrementedNamedInt.get('intelligine.col.eatable')
42
 
43
 
43
 BRAIN_SCHEMA = IncrementedNamedInt.get('intelligine.brain_schema')
44
 BRAIN_SCHEMA = IncrementedNamedInt.get('intelligine.brain_schema')
44
 BRAIN_PART_MOVE = IncrementedNamedInt.get('intelligine.brain.part.move')
45
 BRAIN_PART_MOVE = IncrementedNamedInt.get('intelligine.brain.part.move')

+ 3 - 1
intelligine/display/pygame/visualisation.py View File

1
 import pygame
1
 import pygame
2
 from intelligine.synergy.Colony import Colony
2
 from intelligine.synergy.Colony import Colony
3
 from intelligine.synergy.Rocks import Rocks
3
 from intelligine.synergy.Rocks import Rocks
4
+from intelligine.synergy.object.StockedFood import StockedFood
4
 from synergine.synergy.Simulation import Simulation
5
 from synergine.synergy.Simulation import Simulation
5
 from synergine_xyz.display.PygameImageRotate import PygameImageRotate
6
 from synergine_xyz.display.PygameImageRotate import PygameImageRotate
6
 from synergine_xyz.display.PygameVisualisation import PygameVisualisation
7
 from synergine_xyz.display.PygameVisualisation import PygameVisualisation
164
         'ant': Ant,
165
         'ant': Ant,
165
         'egg': Egg,
166
         'egg': Egg,
166
         'rock': Rock,
167
         'rock': Rock,
167
-        'food': Food
168
+        'food': Food,
169
+        'stocked_food': StockedFood
168
     }
170
     }
169
 }
171
 }
170
 image_rotate = PygameImageRotate()
172
 image_rotate = PygameImageRotate()

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

1
 from intelligine.core.exceptions import CantFindWhereToPut
1
 from intelligine.core.exceptions import CantFindWhereToPut
2
-from intelligine.cst import MOVE_MODE_EXPLO, TYPE_RESOURCE_TRANSFORMABLE, CARRIED
2
+from intelligine.cst import MOVE_MODE_EXPLO, TYPE_RESOURCE_EXPLOITABLE, CARRIED
3
 from intelligine.simulation.object.brain.part.transport.TransportBrainPart import TransportBrainPart
3
 from intelligine.simulation.object.brain.part.transport.TransportBrainPart import TransportBrainPart
4
 from intelligine.synergy.object.Food import Food
4
 from intelligine.synergy.object.Food import Food
5
 from synergine_xyz.cst import POSITION, POSITIONS
5
 from synergine_xyz.cst import POSITION, POSITIONS
9
 
9
 
10
     # TODO: methode __nit_ pour la classe ?
10
     # TODO: methode __nit_ pour la classe ?
11
     _mode_matches = {
11
     _mode_matches = {
12
-        MOVE_MODE_EXPLO: [TYPE_RESOURCE_TRANSFORMABLE],
12
+        MOVE_MODE_EXPLO: [TYPE_RESOURCE_EXPLOITABLE],
13
     }
13
     }
14
 
14
 
15
     @classmethod
15
     @classmethod

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

1
 from intelligine.simulation.object.brain.part.transport.TakeBrainPart import TakeBrainPart
1
 from intelligine.simulation.object.brain.part.transport.TakeBrainPart import TakeBrainPart
2
 from intelligine.synergy.object.ressource.Ressource import Resource
2
 from intelligine.synergy.object.ressource.Ressource import Resource
3
-from intelligine.cst import MOVE_MODE_EXPLO, MOVE_MODE, TYPE_RESOURCE_TRANSFORMABLE, \
4
-    TYPE, MOVE_MODE_GOHOME, PHEROMON_DIR_EXPLO, MOVE_MODE_NURSE, TYPE_NURSERY
3
+from intelligine.cst import MOVE_MODE_EXPLO, TYPE_RESOURCE_EXPLOITABLE, \
4
+    MOVE_MODE_GOHOME, MOVE_MODE_NURSE, TYPE_NURSERY
5
 
5
 
6
 
6
 
7
 class AntTakeBrainPart(TakeBrainPart):
7
 class AntTakeBrainPart(TakeBrainPart):
8
 
8
 
9
     # TODO: methode __init_ pour la classe ? Pour surcharger ici.
9
     # TODO: methode __init_ pour la classe ? Pour surcharger ici.
10
     _mode_matches = {
10
     _mode_matches = {
11
-        MOVE_MODE_EXPLO: [TYPE_RESOURCE_TRANSFORMABLE],
11
+        MOVE_MODE_EXPLO: [TYPE_RESOURCE_EXPLOITABLE],
12
         MOVE_MODE_NURSE: [TYPE_NURSERY],
12
         MOVE_MODE_NURSE: [TYPE_NURSERY],
13
         MOVE_MODE_GOHOME: []
13
         MOVE_MODE_GOHOME: []
14
     }
14
     }

+ 2 - 2
intelligine/synergy/object/Food.py View File

1
 from intelligine.synergy.object.ressource.Ressource import Resource
1
 from intelligine.synergy.object.ressource.Ressource import Resource
2
-from intelligine.cst import TRANSPORTABLE, TYPE, TYPE_RESOURCE_TRANSFORMABLE
2
+from intelligine.cst import TYPE, TYPE_RESOURCE_EXPLOITABLE
3
 
3
 
4
 
4
 
5
 class Food(Resource):
5
 class Food(Resource):
6
 
6
 
7
     def __init__(self, collection, context):
7
     def __init__(self, collection, context):
8
         super().__init__(collection, context)
8
         super().__init__(collection, context)
9
-        context.metas.list.add(TYPE, self.get_id(), TYPE_RESOURCE_TRANSFORMABLE)
9
+        context.metas.list.add(TYPE, self.get_id(), TYPE_RESOURCE_EXPLOITABLE)
10
 
10
 
11
     def get_what_carry(self):
11
     def get_what_carry(self):
12
         clone = self.__class__(self._collection, self._context)
12
         clone = self.__class__(self._collection, self._context)

+ 10 - 0
intelligine/synergy/object/StockedFood.py View File

1
+from intelligine.cst import TYPE, TYPE_RESOURCE_EXPLOITABLE, COL_EATABLE
2
+from intelligine.synergy.object.Food import Food
3
+
4
+
5
+class StockedFood(Food):
6
+
7
+    def __init__(self, collection, context):
8
+        super().__init__(collection, context)
9
+        context.metas.list.remove(TYPE, self.get_id(), TYPE_RESOURCE_EXPLOITABLE)
10
+        self._add_col(COL_EATABLE)