| Total Complexity | 4 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | from intelligine.cst import OBJ_SMELL, INSTANCE_CLASS |
||
| 6 | class SynergyObject(XyzSynergyObject): |
||
| 7 | |||
| 8 | def __init__(self, collection, context): |
||
| 9 | super().__init__(collection, context) |
||
| 10 | self._smell = None |
||
| 11 | context.metas.value.set(INSTANCE_CLASS, self.get_id(), self.__class__) |
||
| 12 | |||
| 13 | def _set_smell(self, smell_type): |
||
| 14 | self._smell = smell_type |
||
| 15 | self._context.metas.value.set(OBJ_SMELL, self.get_id(), smell_type) |
||
| 16 | Simulation.add_smell(smell_type) |
||
| 17 | |||
| 18 | def get_smell(self): |
||
| 19 | if not self._smell: |
||
| 20 | raise Exception('Smell type not defined') |
||
| 21 | return self._smell |
||
| 22 |