public static Map loadMapFromCSV(File f) {
        BufferedReader reader = null;
        Map m = null;
        try {
            reader = new BufferedReader(new FileReader(f));
            String line = reader.readLine();
            if (line.startsWith("m ")) {
                m = new Map(Integer.parseInt(line.split(" ")[1].split("x")[0]),
                            Integer.parseInt(line.split(" ")[1].split("x")[1]));
            }
            while ((line = reader.readLine()) != null) {
                if (line.startsWith("t ")) {
                    m.field[(int)f(line.split(" ")[2])][(int)f(line.split(" ")[3])] = getNewTerrain(line, m);
                }
            }
            
        } catch (IOException ex) {
            Logger.getLogger(MapBuilder.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                reader.close();
            } catch (IOException ex) {
                Logger.getLogger(MapBuilder.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return m;
    }