From 3a13bb1ae15eea381fcc863f4340ea8890c5cf51 Mon Sep 17 00:00:00 2001 From: "guillaume.bonabau" Date: Wed, 3 Apr 2024 17:05:03 +0200 Subject: [PATCH] added variables --- README.md | 5 +++++ src/backend/Simulator.java | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 005b668..1dbf9e5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +When starting a task "TODO" edit it to "TODO-INPROGRESS" +When task is done edit it to "TODO-COMPLETE" +If there is an error in the code edit it to "TODO-ERROR" + + Reminder of game of life rules: 1. Any living cell with strictly fewer than two living neighbors dies (referred to as underpopulation or exposure). diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 52b5f9f..c5c839e 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -26,6 +26,8 @@ public class Simulator extends Thread { private int loopDelay = 150; //TODO : add missing attribute(s) + private int width; + private int height; public Simulator(MyInterface mjfParam) { mjf = mjfParam; @@ -38,8 +40,10 @@ public class Simulator extends Thread { fieldBirthValues = new ArrayList(); fieldSurviveValues = new ArrayList(); - //TODO : add missing attribute initialization - + //TODO-COMPLETE: add missing attribute initialization + //might want to changes those values later + this.width=100; + this.height=100; //Default rule : Survive always, birth never @@ -50,13 +54,13 @@ public class Simulator extends Thread { } public int getWidth() { - //TODO : replace with proper return - return 0; + //TODO-COMPLETE : replace with proper return + return this.width; } public int getHeight() { - //TODO : replace with proper return - return 0; + //TODO-COMPLETE : replace with proper return + return this.height; } //Should probably stay as is