fix playable cell
This commit is contained in:
@@ -25,6 +25,12 @@ public class GomokuBoard{
|
|||||||
System.out.println(test);
|
System.out.println(test);
|
||||||
System.out.println(test.getPlayableCells());
|
System.out.println(test.getPlayableCells());
|
||||||
test.expandBoard(Cardinal.SW);
|
test.expandBoard(Cardinal.SW);
|
||||||
|
test.expandBoard(Cardinal.SW);
|
||||||
|
test.expandBoard(Cardinal.SW);
|
||||||
|
test.expandBoard(Cardinal.SW);
|
||||||
|
test.expandBoard(Cardinal.SW);
|
||||||
|
test.expandBoard(Cardinal.SW);
|
||||||
|
test.expandBoard(Cardinal.SW);
|
||||||
System.out.println(test);
|
System.out.println(test);
|
||||||
System.out.println(test.getPlayableCells());
|
System.out.println(test.getPlayableCells());
|
||||||
}
|
}
|
||||||
@@ -146,7 +152,7 @@ public class GomokuBoard{
|
|||||||
List<GomokuCell> output = new ArrayList<>();
|
List<GomokuCell> output = new ArrayList<>();
|
||||||
for (GomokuCell[] line : this.getAllsCells()) {
|
for (GomokuCell[] line : this.getAllsCells()) {
|
||||||
for (GomokuCell c : line) {
|
for (GomokuCell c : line) {
|
||||||
if (c.isPlayable())
|
if (c.isPlayable() && c.getState() == Color.NIL)
|
||||||
output.add(c);
|
output.add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user