diff --git a/src/GomokuBoard.java b/src/GomokuBoard.java index b82169e..089ffc5 100644 --- a/src/GomokuBoard.java +++ b/src/GomokuBoard.java @@ -7,7 +7,7 @@ public class GomokuBoard { /** The width of the GomokuBoard.*/ private int boardWith; /** The height of the GomokuBoard.*/ - private int bordHeight; + private int boardHeight; //------------------Constructors-------------------------- @@ -19,7 +19,7 @@ public class GomokuBoard { public GomokuBoard(int width, int height){ this.firstCell = new GomokuCell(Color.NIL); this.boardWith = width; - this.bordHeight = height; + this.boardHeight = height; } //------------------Gets-------------------------- @@ -45,6 +45,13 @@ public class GomokuBoard { } + private GomokuCell[][] getAllsCells(){ + GomokuCell[][] cells = new GomokuCell[this.boardWith][this.boardHeight]; + int i = 0, j = 0; + GomokuCell nextLine = this.firstCell.getNeighbour(Cardinal.S); + return cells; + } + /** * This method return a list of playable cell. * @return List of GomokuCell wich all is playable. @@ -54,7 +61,7 @@ public class GomokuBoard { List output = new ArrayList<>(); GomokuCell act = null; for (int i = 0; i < this.boardWith; i++) { - for (int j = 0; j < this.bordHeight; j++) { + for (int j = 0; j < this.boardHeight; j++) { act = this.get(i,j); if (act.isPlayable()){ output.add(act); @@ -65,4 +72,11 @@ public class GomokuBoard { return output; } + + //------------------Overides-------------------------- + + @Override + public String toString() { + return ""; + } } diff --git a/src/GomokuCell.java b/src/GomokuCell.java index 36862ed..9c6cdb6 100644 --- a/src/GomokuCell.java +++ b/src/GomokuCell.java @@ -110,10 +110,12 @@ public class GomokuCell{ switch (this.getSate()) { case Color.NIL: return " "; - + case Color.BLACK: + return "X"; + case Color.WHITE: + return "0"; default: - break; + return "BUG"; } - return this.state.toString(); } }