|
@@ -19,9 +19,9 @@ class EngulfSubjects(XYZSubjects):
|
19
|
19
|
|
20
|
20
|
if isinstance(value, Cell):
|
21
|
21
|
try:
|
22
|
|
- del self.cell_xyz[value.position]
|
23
|
|
- except KeyError:
|
24
|
|
- pass # TODO: cE DICT DOIT CONTENIR DES LISTES DE SUBJECTS
|
|
22
|
+ self.cell_xyz.get(value.position, []).remove(value)
|
|
23
|
+ except ValueError:
|
|
24
|
+ pass
|
25
|
25
|
|
26
|
26
|
if isinstance(value, Grass):
|
27
|
27
|
del self.grass_xyz[value.position]
|
|
@@ -30,10 +30,10 @@ class EngulfSubjects(XYZSubjects):
|
30
|
30
|
super().append(p_object)
|
31
|
31
|
|
32
|
32
|
if isinstance(p_object, Cell):
|
33
|
|
- self.cell_xyz[p_object.position] = p_object
|
|
33
|
+ self.cell_xyz.get(p_object.position, []).append(p_object)
|
34
|
34
|
|
35
|
35
|
if isinstance(p_object, Grass):
|
36
|
|
- self.grass_xyz[p_object.position] = p_object
|
|
36
|
+ self.grass_xyz.get(p_object.position, []).append(p_object)
|
37
|
37
|
|
38
|
38
|
|
39
|
39
|
class Engulf(XYZSimulation):
|