to string and setState + doc
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user