diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index a8085d2..5107178 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -137,7 +137,11 @@ public class Simulator extends Thread { */ public void togglePause() { // TODO : actually toggle the corresponding flag - } + pauseFlag=!pauseFlag; + } + + + /** * method called when clicking on a cell in the interface @@ -263,6 +267,17 @@ public class Simulator extends Thread { public void setLoopDelay(int delay) { //TODO : complete method +// this.loopDelay = delay; +// if (pauseFlag) { +// return; +// } +// +// try { +// Thread.sleep(loopDelay); +// } catch (InterruptedException e) { +// Thread.currentThread().interrupt(); // Restore interrupted status. +// System.err.println("Simulation step was interrupted."); +// } } public void toggleClickAction() {