Skip to content

Commit

Permalink
Revert "Update Exporter"
Browse files Browse the repository at this point in the history
This reverts commit bae1a1f.
  • Loading branch information
ThisMatt committed Oct 3, 2023
1 parent bae1a1f commit 86df4d8
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ protected org.w3c.dom.Element createBoardElement(Document newDocument) {
SkyscrapersBoard board = (SkyscrapersBoard) puzzle.getTree().getRootNode().getBoard();

org.w3c.dom.Element boardElement = newDocument.createElement("board");
boardElement.setAttribute("size", String.valueOf(board.getWidth()));
boardElement.setAttribute("width", String.valueOf(board.getWidth()));
boardElement.setAttribute("height", String.valueOf(board.getHeight()));

org.w3c.dom.Element cellsElement = newDocument.createElement("cells");
for (PuzzleElement puzzleElement : board.getPuzzleElements()) {
Expand All @@ -29,20 +30,20 @@ protected org.w3c.dom.Element createBoardElement(Document newDocument) {

org.w3c.dom.Element axisEast = newDocument.createElement("axis");
axisEast.setAttribute("side", "east");
for (int i=0; i<board.getWidth(); i++) {
for (SkyscrapersClue clue : board.getEastClues()) {
org.w3c.dom.Element clueElement = newDocument.createElement("clue");
clueElement.setAttribute("value", String.valueOf(board.getEastClues().get(i).getData()));
clueElement.setAttribute("index", String.valueOf(board.getWestClues().get(i).getData()));
clueElement.setAttribute("value", String.valueOf(clue.getData()));
clueElement.setAttribute("index", SkyscrapersClue.colNumToString(clue.getIndex()));
axisEast.appendChild(clueElement);
}
boardElement.appendChild(axisEast);

org.w3c.dom.Element axisSouth = newDocument.createElement("axis");
axisSouth.setAttribute("side", "south");
for (int i=0; i<board.getWidth(); i++) {
for (SkyscrapersClue clue : board.getSouthClues()) {
org.w3c.dom.Element clueElement = newDocument.createElement("clue");
clueElement.setAttribute("value", String.valueOf(board.getSouthClues().get(i).getData()));
clueElement.setAttribute("index", String.valueOf(board.getNorthClues().get(i).getData()));
clueElement.setAttribute("value", String.valueOf(clue.getData()));
clueElement.setAttribute("index", String.valueOf(clue.getIndex()));
axisSouth.appendChild(clueElement);
}
boardElement.appendChild(axisSouth);
Expand Down

0 comments on commit 86df4d8

Please sign in to comment.