Code Duplication    Length = 10-11 lines in 2 locations

intelligine/synergy/object/ant/Ant.py 2 locations

@@ 60-70 (lines=11) @@
57
    def get_carried(self):
58
        return self._carried
59
60
    def carry(self, obj):
61
        self._carried = obj
62
        self._context.metas.states.add(self.get_id(), CARRYING)
63
        self._add_col(COL_TRANSPORTER_CARRYING)
64
        self._remove_col(COL_TRANSPORTER_NOT_CARRYING)
65
        obj.set_is_carried(True, self)
66
        self._context.metas.value.set(CARRY, self.get_id(), obj.get_id())
67
        # TODO: pour le moment hardcode, a gerer dans AntTakeBrainPart (callback en fct de ce qui est depose)
68
        if isinstance(obj, Food):
69
            self.get_brain().switch_to_mode(MODE_GOHOME)
70
            self.get_movement_molecule_gland().appose()
71
72
    def is_carrying(self):
73
        if self._carried:
@@ 46-55 (lines=10) @@
43
    def get_movement_molecule_gland(self):
44
        return self.get_body_part(BODY_PART_PHEROMONE_GLAND)
45
46
    def put_carry(self, obj, position=None):
47
        if position is None:
48
            position = self._get_position()
49
        self._carried = None
50
        obj.set_position(position)
51
        obj.set_is_carried(False, self)
52
        self._context.metas.states.remove(self.get_id(), CARRYING)
53
        self._context.metas.value.unset(CARRY, self.get_id())
54
        self._add_col(COL_TRANSPORTER_NOT_CARRYING)
55
        self._remove_col(COL_TRANSPORTER_CARRYING)
56
57
    def get_carried(self):
58
        return self._carried