pycopancore icon indicating copy to clipboard operation
pycopancore copied to clipboard

two culture setters for world

Open zugnachpankow opened this issue 2 years ago • 0 comments

In pycopancore/model_components/base/implementation/world.py line 100 - 130 there are two setters for the culture, is this redundant?

`

@property
def culture(self):
    """Get world's culture."""
    return self._culture

@culture.setter
def culture(self, c):
    """Set world's culture."""
    if self._culture is not None:
        # first deregister from previous culture's list of worlds:
        self._culture.worlds.remove(self)
    if c is not None:
        assert isinstance(c, I.Culture), \
            "Culture must be taxon type Culture"
        c._worlds.add(self)
    self._culture = c

@property
def culture(self):
    """Get the Culture acting in this World."""
    return self._culture

@culture.setter
def culture(self, c):
    """Set the World the SocialSystem is part of."""
    if self._culture is not None:
        self._culture._worlds.remove(self)
    assert isinstance(c, I.Culture), "culture must be of taxon type Culture"
    c._worlds.add(self)
    self._culture = c

`

zugnachpankow avatar Jun 08 '22 13:06 zugnachpankow