This commit is contained in:
Aubin DORIVAL
2025-03-24 10:33:13 +01:00
parent cea1808cb1
commit 4e0f5ad0c4
2 changed files with 15 additions and 3 deletions

View File

@@ -1,7 +1,6 @@
public enum Color {
NIL,
WHITE,
BLACK;

View File

@@ -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;
}