summaryrefslogtreecommitdiff
path: root/src/mapdata.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mapdata.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mapdata.py b/src/mapdata.py
index ec0feff..23c6b83 100644
--- a/src/mapdata.py
+++ b/src/mapdata.py
@@ -1,7 +1,6 @@
from common import *
import weakref
import mapfile
-import base64
TILE_SIZE = (24,24)
MAP_SIZE_IN_TILES = (512,512)
@@ -250,7 +249,7 @@ class KPNodeAction(object):
@mapfile.dumpable('node')
class KPNode(object):
__dump_attribs__ = (
- 'position', 'actions', 'level', 'isStop', 'mapChange',
+ 'position', 'actions', 'level', 'mapChange',
'transition', 'mapID', 'foreignID')
def _dump(self, mapObj, dest):
@@ -265,12 +264,15 @@ class KPNode(object):
self.position = (0,0)
self.actions = []
self.exits = []
- self.level = [0,0]
- self.isStop = False
+ self.level = None
self.mapChange = None
self.transition = 0
self.mapID = None
self.foreignID = None
+
+ def isStop(self):
+ return True if (self.level or self.mapChange or len(self.exits) != 2) else False
+
@mapfile.dumpable('path')
@@ -304,7 +306,7 @@ class KPPath(object):
self.secret = 0 # 0 = unlocks from normal exit, 1 = unlocks from secret exit
if cloneFrom is None:
- self.animation = None
+ self.animation = 0
else:
self.animation = cloneFrom.animation
@@ -388,6 +390,12 @@ class KPMap(object):
dumped = mapfile.dump(self)
open(path, 'wb').write(dumped)
+ def export(self, path):
+ from exporter import KPMapExporter
+ exp = KPMapExporter(self)
+ data = exp.build()
+ open(path, 'wb').write(data)
+
def __init__(self):
self.filePath = None