From 1ee33964095fc01e5a92082cc730ac56482cb643 Mon Sep 17 00:00:00 2001 From: Hang <thi-hang.NGUYEN@etu.univ-amu.fr> Date: Mon, 14 Nov 2022 08:25:48 +0100 Subject: [PATCH] THN --- app/src/main/java/model/ComputerPlayer.java | 1 + app/src/main/java/model/GrayCell.java | 18 +++++++++++++++--- app/src/main/java/model/SquareCell.java | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/model/ComputerPlayer.java b/app/src/main/java/model/ComputerPlayer.java index 7796e9c..a869940 100644 --- a/app/src/main/java/model/ComputerPlayer.java +++ b/app/src/main/java/model/ComputerPlayer.java @@ -3,6 +3,7 @@ package model; import com.sun.prism.paint.Color; public class ComputerPlayer implements Player{ + PlayStrate sdfdsfdsfm @Override public boolean isHuman() { return false; diff --git a/app/src/main/java/model/GrayCell.java b/app/src/main/java/model/GrayCell.java index b417d3f..830724a 100644 --- a/app/src/main/java/model/GrayCell.java +++ b/app/src/main/java/model/GrayCell.java @@ -10,8 +10,14 @@ import java.util.List; public class GrayCell extends AbstractCell{ Cell[][] cells; - int dim; - public GrayCell(Cell[][] cells, int dim){ + int nberOfRows; + int nberOfColums; + List<Cell> neighbours; + + public GrayCell(Cell[][] cells, int rows, int colums){ + this.cells=new Cell[rows][colums]; + this.nberOfRows=rows; + this.nberOfColums=colums; } @@ -26,8 +32,13 @@ public class GrayCell extends AbstractCell{ @Override public List<Cell> getNeighbours() { List<Cell> neighbours= new ArrayList<Cell>(); + for(int i=0; i< nberOfRows;i++){ + for(int j=0; j< nberOfColums;j++){ - return null; + } + } + + return neighbours; } /** @@ -38,6 +49,7 @@ public class GrayCell extends AbstractCell{ */ @Override public void setNeighbours(List<Cell> cells) { + this.neighbours=cells; } diff --git a/app/src/main/java/model/SquareCell.java b/app/src/main/java/model/SquareCell.java index 0ff9a94..d4941b2 100644 --- a/app/src/main/java/model/SquareCell.java +++ b/app/src/main/java/model/SquareCell.java @@ -35,6 +35,8 @@ public class SquareCell extends AbstractCell{ */ @Override public List<Cell> getNeighbours() { + + return this.neighbours; } -- GitLab