diff --git a/src/game/GameBoardJson.java b/src/game/GameBoardJson.java index 0a3d62f9117b9c34a1d4df9b3623eeb94cfc5e46..b0cc3043de7335354cced857dcfde672f8cb8f03 100644 --- a/src/game/GameBoardJson.java +++ b/src/game/GameBoardJson.java @@ -20,7 +20,7 @@ public class GameBoardJson { for (int i = 0; i < height; i++) { JsonArray currentRow = rows.getJsonArray(i); for (int j = 0; j < width; j++) { - boolean currentCellAlive = currentRow.getBoolean(j); + boolean currentCellAlive = currentRow.getString(j).equals("+"); if (currentCellAlive) board.get(i,j).setAlive(true); } @@ -37,12 +37,16 @@ public class GameBoardJson { for (int i = 0; i < height; i++) { JsonArrayBuilder currentRow = Json.createArrayBuilder(); for (int j = 0; j < width; j++) { - currentRow.add(board.get(i, j).isAlive()); + if (board.get(i, j).isAlive()){ + currentRow.add("+"); + } else { + currentRow.add("-"); + } } rowsBuilder.add(currentRow.build()); } - JsonObject boardObject = Json.createObjectBuilder() //TODO többsoros + JsonObject boardObject = Json.createObjectBuilder() .add("file", destination.getName()) .add("size", Json.createObjectBuilder()