Steffen Illium f5c6317158 Remove BoundDestination Object
New Variable 'var_can_be_bound'
Observations adjusted accordingly
2023-10-12 17:14:32 +02:00

25 lines
524 B
Python

# noinspection PyAttributeOutsideInit
class BoundEntityMixin:
@property
def bound_entity(self):
return self._bound_entity
@property
def name(self):
if self.bound_entity:
return f'{self.__class__.__name__}({self.bound_entity.name})'
else:
print()
def belongs_to_entity(self, entity):
return entity == self.bound_entity
def bind_to(self, entity):
self._bound_entity = entity
def unbind(self):
self._bound_entity = None