From 707ad7329178be4fcf2360b6eb33c45ab9377b02 Mon Sep 17 00:00:00 2001 From: Dorian HAMDANI Date: Mon, 7 Apr 2025 08:08:51 +0200 Subject: [PATCH] Change cell linking method using new Cardinal methods --- src/GomokuCell.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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--------------------------