to string and setState + doc

This commit is contained in:
Aubin DORIVAL
2025-03-28 10:28:49 +01:00
parent e82538c6e5
commit 31e7929716
21 changed files with 75 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
import java.util.EnumMap;
import java.util.concurrent.ExecutionException;
/**
* This class is cell of the board of the Gomoku game.
@@ -47,6 +48,17 @@ public class GomokuCell{
return this.state;
}
//------------------Sets--------------------------
/**
*
*/
public void setState(Color c){
if (!this.isPlayable())
throw new IllegalStateException("This cell is not playable !" + this.toString());
this.state = c;
}
//------------------Booleans--------------------------
@@ -86,4 +98,9 @@ public class GomokuCell{
this.neighbour.put(car, cell);
}
//------------------Overides--------------------------
@Override
public String toString() {
return this.neighbour.toString() + this.state.toString();
}
}