setStat docs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user