summaryrefslogblamecommitdiff
path: root/tmwcon/src/converter/WLKInterface.java
blob: 36d2b367bfdd4003bd89737006a68483d398833f (plain) (tree)
1
2
3
4



                                                    





























                                                               
/*
 * TMWServ to eAthena Converter (c) 2008 Jared Adams
 * License: GPL, v2 or later
 */

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();
        }
    }
}