diff --git a/src/GomokuCell.java b/src/GomokuCell.java index cab9345..bfe1df9 100644 --- a/src/GomokuCell.java +++ b/src/GomokuCell.java @@ -1,8 +1,7 @@ import java.util.EnumMap; import java.util.HashMap; import java.util.Map; -import java.util.List; -import java.util.Arrays; + /** * This class is cell of the board of the Gomoku game. */ @@ -137,9 +136,8 @@ public class GomokuCell{ public static void link(GomokuCell c1, GomokuCell c2, Cardinal c1Toc2){ if (c1 == null || c2 == null) return ; - List cardinals = Arrays.asList(Cardinal.values()); c1.linkCell(c1Toc2, c2); - c2.linkCell(cardinals.get((cardinals.indexOf(c1Toc2) + 4) % 8), c1); + c2.linkCell(c1Toc2.inverse(), c1); } //------------------Overides--------------------------