This commit is contained in:
@@ -127,6 +127,11 @@ public class SudokuSerializer {
|
||||
return jsonRoot;
|
||||
}
|
||||
|
||||
private static void createSaveDir() {
|
||||
File f = new File("save");
|
||||
f.mkdir();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a serialized MultiDoku in a JSON file.
|
||||
*
|
||||
@@ -134,6 +139,7 @@ public class SudokuSerializer {
|
||||
* @return String, the path of the save.
|
||||
*/
|
||||
public static String saveMultiDoku(final MultiDoku doku) {
|
||||
createSaveDir();
|
||||
JSONObject jsonRoot = serializeSudoku(doku);
|
||||
|
||||
File f = new File("save", "save.json");
|
||||
@@ -151,6 +157,7 @@ public class SudokuSerializer {
|
||||
}
|
||||
|
||||
public static String saveMultiDoku(final MultiDoku doku, final int saveToOverwrite) {
|
||||
createSaveDir();
|
||||
File f;
|
||||
if (saveToOverwrite == 0) {
|
||||
f = new File("save", "save.json");
|
||||
|
||||
Reference in New Issue
Block a user