From a1d30f7ad74471b37734c37bbb6e71020ea55d65 Mon Sep 17 00:00:00 2001 From: yoenm Date: Tue, 14 May 2024 17:21:01 +0200 Subject: [PATCH] commencement de TODO: apply game rule to all cells of the field --- OOP_D9_Project/src/backend/Simulator.java | 31 +++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/OOP_D9_Project/src/backend/Simulator.java b/OOP_D9_Project/src/backend/Simulator.java index ee2d7b6..ea48a7a 100644 --- a/OOP_D9_Project/src/backend/Simulator.java +++ b/OOP_D9_Project/src/backend/Simulator.java @@ -25,6 +25,8 @@ public class Simulator extends Thread { private boolean clickActionFlag; private int loopDelay = 150; + private int[][] grid; + //TODO : add missing attribute(s) public Simulator(MyInterface mjfParam) { @@ -39,8 +41,15 @@ public class Simulator extends Thread { fieldSurviveValues = new ArrayList(); //TODO : add missing attribute initialization - - + grid = new int[COL_NUM][LINE_NUM]; + // we set the grid of the size of col_num and line_num + for (int x=0; x