package school_project.Parsers;

import school_project.Map;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

public interface FileParser {

    /**
     * Parse the file and create a Map with its shape and pieces setup
     *
     * @param file file to parse
     * @param saved_data does the saved data should be added to the map
     * @return Map Object parsed with file data
     * @see <a href="http://school.debucquoy.me/spec/FileParser.html#file-parser-specification"> Parser Specification</a>
     * @throws FileNotFoundException if the file was not found or was not accessible
     * @throws IOException if an I/O occurs
     */
    Map getLevel(File file, boolean saved_data) throws IOException;

    /**
     * Save Map to a file without all it's data
     * Could be used for generating level file. might not be used in game.
     * @param file the file where to save
     * @param levelData the map to save
     * @param save_data should save the map data (need to be false only in development I think)
     * @throws FileNotFoundException The file could not be created
     * @throws IOException if an I/O occurs
     */
    void saveLevel(File file, Map levelData, boolean save_data) throws IOException;
}
