diff options
Diffstat (limited to '')
-rw-r--r-- | src/mapdata.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/mapdata.py b/src/mapdata.py index 3ce63a6..2f1f5a2 100644 --- a/src/mapdata.py +++ b/src/mapdata.py @@ -23,11 +23,7 @@ class KPLayer(object): def __init__(self): self.name = '' - self.tileset = '' - self.objects = [] self._visible = True - self.cache = ['DUMMY_FLAG'] - self.updateCache() @property def visible(self): @@ -39,6 +35,24 @@ class KPLayer(object): return self._visible = value + self._visibilityChanged(value) + + def _visibilityChanged(self, value): + pass + + +class KPTileLayer(KPLayer): + def __repr__(self): + return "<KPTileLayer %r with %r>" % (self.name, self.tileset) + + def __init__(self): + KPLayer.__init__(self) + self.tileset = '' + self.objects = [] + self.cache = ['DUMMY_FLAG'] + self.updateCache() + + def _visibilityChanged(self, value): for obj in self.objects: item = obj.qtItem if item: @@ -207,7 +221,7 @@ class KPMap(object): def createNewLayer(self, tilesetName): - layer = KPLayer() + layer = KPTileLayer() layer.name = "Layer %d" % self.nextLayerNumber self.nextLayerNumber += 1 layer.tileset = tilesetName |