summaryrefslogtreecommitdiff
path: root/tools/tmwcon/src/converter/WLKInterface.java
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tmwcon/src/converter/WLKInterface.java')
-rw-r--r--tools/tmwcon/src/converter/WLKInterface.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/tmwcon/src/converter/WLKInterface.java b/tools/tmwcon/src/converter/WLKInterface.java
new file mode 100644
index 00000000..da60c688
--- /dev/null
+++ b/tools/tmwcon/src/converter/WLKInterface.java
@@ -0,0 +1,31 @@
+//
+
+package converter;
+
+import java.io.*;
+
+import tiled.core.*;
+import tiled.plugins.tmw.*;
+
+public class WLKInterface {
+ private File folder;
+ public WLKInterface(File folder) {
+ WLKWriter.class.getName();
+ this.folder = folder;
+ File f = new File("server-data/data");
+ f.mkdirs();
+ }
+
+ public void write(String name, Map map) {
+ File wlk = new File(folder, name + ".wlk");
+
+ try {
+ wlk.createNewFile();
+ WLKWriter.writeMap(map, new FileOutputStream(wlk));
+ System.out.println("WLK written");
+ } catch (Exception e) {
+ System.out.println("Prolem writing WLK file:");
+ e.printStackTrace();
+ }
+ }
+}