cells
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
|
||||
|
||||
public enum Color {
|
||||
|
||||
NIL,
|
||||
WHITE,
|
||||
BLACK;
|
||||
|
||||
@@ -2,10 +2,11 @@ import java.util.EnumMap;
|
||||
|
||||
public class GomokuCell{
|
||||
private EnumMap<Cardinal,GomokuCell> neighbour;
|
||||
public Color state;
|
||||
private Color state;
|
||||
|
||||
public GomokuCell(){
|
||||
public GomokuCell(Color state){
|
||||
this.neighbour = new EnumMap<>(Cardinal.class);
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void linkCell(Cardinal car, GomokuCell cell){
|
||||
@@ -16,6 +17,18 @@ public class GomokuCell{
|
||||
return this.neighbour.get(car);
|
||||
}
|
||||
|
||||
public boolean isEmpty(){
|
||||
return this.state == Color.NIL;
|
||||
}
|
||||
|
||||
public boolean isPlayed(){
|
||||
return !this.isEmpty();
|
||||
}
|
||||
|
||||
public Color getSate(){
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public EnumMap<Cardinal, GomokuCell> getAllNeighbour(){
|
||||
return neighbour;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user