is playable change

This commit is contained in:
Aubin DORIVAL
2025-03-28 10:47:29 +01:00
parent 31e7929716
commit 6b2d450edb
20 changed files with 25 additions and 20 deletions

View File

@@ -1,6 +1,8 @@
import java.util.EnumMap;
import java.util.concurrent.ExecutionException;
import javax.smartcardio.Card;
/**
* This class is cell of the board of the Gomoku game.
*/
@@ -83,7 +85,10 @@ public class GomokuCell{
* @return True if the current cell can be played with the condition of the gomoku.
*/
public boolean isPlayable(){
return this.neighbour.size() > 0;
for (Cardinal c : Cardinal.values()) {
if (this.getNeighbour(c).isPlayed()) return true;
}
return false;
}