This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user