From 64a3e59afe2734226c95d9ebc5939130c8ac1624 Mon Sep 17 00:00:00 2001 From: Raphaelsav <94864277+Raphaelsav@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:16:03 +0200 Subject: [PATCH] completed clickCell(x,y) method to change value of cell by clicking it --- src/backend/Simulator.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 73d66e2..f909703 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -157,6 +157,16 @@ public class Simulator extends Thread { */ public void clickCell(int x, int y) { //TODO : complete method + //if clickActionFlag = true then create an agent + //else if flag = false then change value of cell + if(clickActionFlag) { + + }else { + if(getCell(x, y)==0) { + setCell(x, y, 1); + }else {setCell(x, y, 0);} + } + } /**