This commit is contained in:
Guillaume BONABAU 2024-04-10 16:45:02 +02:00
commit f2bcfcda14
2 changed files with 29 additions and 5 deletions

View File

@ -242,7 +242,22 @@ public class Simulator extends Thread {
* @param val to set in cell * @param val to set in cell
*/ */
public void setCell(int x, int y, int val) { public void setCell(int x, int y, int val) {
this.table.getCell(x, y).setValue(val); //TODO : complete method
//j'ai ajouté une base, mais manque la partie qui modifie la valeur de la cellule
int currentCellValue = getCell(x, y);
// set cell value to !currentCellValue
}
public void countAround(int x, int y) {
//enableLogs
//getCell
//if loopingBorder TRUE, border count as living.
if (loopingBorder == true){
}
else {
}
} }
@ -307,12 +322,20 @@ public class Simulator extends Thread {
} }
public boolean isLoopingBorder() { public boolean isLoopingBorder() {
//TODO : complete method with proper return //ODO-COMPLETE : complete method with proper return
return false; return loopingBorder;
} }
public void toggleLoopingBorder() { public void toggleLoopingBorder() {
//TODO : complete method //ODO-COMPLETE : complete method
loopingBorder = !loopingBorder;
if (enableLogs) {
if (loopingBorder) {
System.out.println("toggleLoopingBorder called, set loopingBorder to true");
} else {
System.out.println("toggleLoopingBorder called, set loopingBorder to false");
}
}
} }

View File

@ -393,6 +393,7 @@ public class MyInterface extends JFrame {
} }
public void update (int stepCount) { public void update (int stepCount) {
System.out.println("update called");
this.setStepBanner("Step : "+ stepCount); this.setStepBanner("Step : "+ stepCount);
this.repaint(); this.repaint();
} }