setStat docs

This commit is contained in:
Aubin DORIVAL
2025-03-28 10:57:12 +01:00
parent 6b2d450edb
commit 96b08f94eb
20 changed files with 43 additions and 29 deletions

View File

@@ -35,8 +35,8 @@ public class GomokuCell{
}
/**
* Return neighbour.
* @return The EnumMap of neighbour.
* Return neighbours.
* @return The EnumMap of neighbours.
*/
public EnumMap<Cardinal, GomokuCell> getAllNeighbour(){
return neighbour;
@@ -53,7 +53,9 @@ public class GomokuCell{
//------------------Sets--------------------------
/**
*
* Change state of the current cell.
* @param c The color of the token played.
* @throws IllegalStateException If the cell is not playable.
*/
public void setState(Color c){
if (!this.isPlayable())
@@ -86,7 +88,8 @@ public class GomokuCell{
*/
public boolean isPlayable(){
for (Cardinal c : Cardinal.values()) {
if (this.getNeighbour(c).isPlayed()) return true;
GomokuCell current = this.getNeighbour(c);
if (current != null && current.isPlayed()) return true;
}
return false;
}