merge
All checks were successful
Linux arm64 / Build (push) Successful in 24m8s

This commit is contained in:
Melvyn
2025-01-24 16:17:56 +01:00
parent 981bf8529d
commit 8f4330f710
21 changed files with 42 additions and 45 deletions

View File

@@ -6,11 +6,10 @@ import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
import sudoku.Block;
import sudoku.Cell;
import sudoku.ImmutableCell;
import sudoku.MultiDoku;
import sudoku.Sudoku;
import sudoku.structure.Block;
import sudoku.structure.Cell;
import sudoku.structure.MultiDoku;
import sudoku.structure.Sudoku;
public class SudokuSerializer {
@@ -44,7 +43,7 @@ public class SudokuSerializer {
JSONObject cellJsonObject = new JSONObject();
cellJsonObject.put("blockID", blockID);
cellJsonObject.put("symboleIndex", symboleIndex);
if (cell instanceof ImmutableCell) {
if (!cell.isMutable()) {
cellJsonObject.put("immutable", true);
}
jsonCells.put(cellJsonObject);
@@ -111,7 +110,7 @@ public class SudokuSerializer {
JSONObject entry = cellsJson.getJSONObject(i);
int symboleIndex = entry.getInt("symboleIndex");
if (entry.has("immutable")) {
cells.add(new ImmutableCell(symboleIndex));
cells.add(new Cell(symboleIndex, false));
} else {
cells.add(new Cell(symboleIndex));
}