Remove old countAlignedCells method
This commit is contained in:
@@ -1,11 +1,7 @@
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
>>>>>>> 20e2f2eaec0f2988bef55ac30d3f0b3f123b171d
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The board of the game Gomoku.
|
* The board of the game Gomoku.
|
||||||
@@ -238,20 +234,7 @@ public class GomokuBoard {
|
|||||||
* @param cell A cell.
|
* @param cell A cell.
|
||||||
* @return Map of number aligned cells.
|
* @return Map of number aligned cells.
|
||||||
*/
|
*/
|
||||||
public Map<Cardinal, Integer> countAlignedCells(GomokuCell cell) {
|
public EnumMap<Cardinal, Integer> countAlignedCells(GomokuCell cell) {
|
||||||
|
|
||||||
Map<Cardinal, Integer> map = new HashMap<>();
|
|
||||||
Map<Cardinal, Integer> mapColor = cell.getSameColorNeighbour();
|
|
||||||
|
|
||||||
map.put(Cardinal.N, mapColor.get(Cardinal.N) + mapColor.get(Cardinal.S) + 1);
|
|
||||||
map.put(Cardinal.W, mapColor.get(Cardinal.W) + mapColor.get(Cardinal.E) + 1);
|
|
||||||
map.put(Cardinal.NW, mapColor.get(Cardinal.NW) + mapColor.get(Cardinal.SE) + 1);
|
|
||||||
map.put(Cardinal.SW, mapColor.get(Cardinal.SW) + mapColor.get(Cardinal.NE) + 1);
|
|
||||||
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumMap<Cardinal, Integer> countAlignedCellsv2(GomokuCell cell) {
|
|
||||||
|
|
||||||
EnumMap<Cardinal, Integer> map = new EnumMap<>(Cardinal.class);
|
EnumMap<Cardinal, Integer> map = new EnumMap<>(Cardinal.class);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user