cell
This commit is contained in:
23
src/GomokuCell.java
Normal file
23
src/GomokuCell.java
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import java.util.EnumMap;
|
||||||
|
|
||||||
|
public class GomokuCell{
|
||||||
|
private EnumMap<Cardinal,GomokuCell> neighbour;
|
||||||
|
public Color state;
|
||||||
|
|
||||||
|
public GomokuCell(){
|
||||||
|
this.neighbour = new EnumMap<>(Cardinal.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void linkCell(Cardinal car, GomokuCell cell){
|
||||||
|
this.neighbour.put(car, cell);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GomokuCell getNeighbour(Cardinal car){
|
||||||
|
return this.neighbour.get(car);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumMap<Cardinal, GomokuCell> getAllNeighbour(){
|
||||||
|
return neighbour;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user