diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 342dfd5..abcf719 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -24,6 +24,7 @@ public class Simulator extends Thread { private boolean loopingBorder; private boolean clickActionFlag; private int loopDelay = 150; + private int[][] grid; //TODO : add missing attribute(s) @@ -152,8 +153,12 @@ public class Simulator extends Thread { * @return value of cell */ public int getCell(int x, int y) { - //TODO : complete method with proper return - return 0; + if (x >= 0 && x < COL_NUM && y >= 0 && y < LINE_NUM) { + return grid[x][y]; + } + else { + return -1;// If the coordinates are out of the grid, we return -1 as a message error + } } /** *