diff --git a/src/game/Cell.java b/src/game/Cell.java index 6873529046fdc7d22517d01cada8983652915d39..36a80f42ec449133b3d2af284572a2c550604478 100644 --- a/src/game/Cell.java +++ b/src/game/Cell.java @@ -6,7 +6,7 @@ import java.util.List; public class Cell { private boolean alive, aliveNextTurn; - private List<Cell> neighbours; //TODO iterator + private List<Cell> neighbours; public Cell() { alive = false; diff --git a/src/game/GameBoard.java b/src/game/GameBoard.java index 326d7686c803e5a6075d1abda2739f529586ffd5..0b46f38641e15efe8b6f205ce35d92b4ccea408d 100644 --- a/src/game/GameBoard.java +++ b/src/game/GameBoard.java @@ -5,7 +5,7 @@ import java.util.List; public class GameBoard { - private List<Cell> cells; //TODO iterator + private List<Cell> cells; private int height, width, size; public GameBoard(int height, int width) { @@ -45,12 +45,12 @@ public class GameBoard { } synchronized public void step() { - for (int i=0; i<size; i++) - cells.get(i).checkNextState(); + for (Cell i: cells) { + i.checkNextState(); + } - for (int i = 0; i < size; i++) { - cells.get(i).nextState(); - + for (Cell i: cells) { + i.nextState(); } } diff --git a/src/game/GameWindowButtonsListener.java b/src/game/GameWindowButtonsListener.java index 0d86b9e60e17e73a0415faba443d1e96d9ec8808..73cbcb7acdb246ff6b1a9dfc68d10747e790573b 100644 --- a/src/game/GameWindowButtonsListener.java +++ b/src/game/GameWindowButtonsListener.java @@ -20,11 +20,6 @@ public class GameWindowButtonsListener implements ActionListener { case "stop": model.stop(); break; - /*case "save": //TODO lehet, nem kell - model.saveToFile(); - break; - - */ } } } diff --git a/src/game/StartNewButtonListener.java b/src/game/StartNewButtonListener.java index cc5b43154d7449fe530347c219ae567e2698932a..05d606cd01693b68ce0f89d5fff4f30ced3ba015 100644 --- a/src/game/StartNewButtonListener.java +++ b/src/game/StartNewButtonListener.java @@ -8,13 +8,13 @@ public class StartNewButtonListener implements ActionListener { private JTextField heightTextField, widthTextField; private StartModel model; - private final int defaultHight, defaultWidth; + private final int defaultHeight, defaultWidth; public StartNewButtonListener(StartModel model, JTextField heightText, JTextField widthText) { heightTextField = heightText; widthTextField = widthText; this.model = model; - this.defaultHight = model.getDefaultHeight(); + this.defaultHeight = model.getDefaultHeight(); this.defaultWidth = model.getDefaultWidth(); } @@ -25,7 +25,7 @@ public class StartNewButtonListener implements ActionListener { try { height = Integer.parseInt(heightTextField.getText()); } catch (Exception exc) { - height = defaultHight; + height = defaultHeight; } try { @@ -35,7 +35,7 @@ public class StartNewButtonListener implements ActionListener { } if (height < 10) { - height = defaultHight; + height = defaultHeight; } if (width < 10) {