From 26f029004784f668057c9c9b243a76ac289c525a Mon Sep 17 00:00:00 2001 From: Katchan Date: Fri, 15 Oct 2021 18:53:34 +0200 Subject: [PATCH] refactor Tuple to Triplet and create Cardinal enum on utils package --- .../src/main/java/fr/lnl/game/server/utils/Cardinal.java | 5 +++++ .../fr/lnl/game/server/utils/{Tuple.java => Triplet.java} | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 server/src/main/java/fr/lnl/game/server/utils/Cardinal.java rename server/src/main/java/fr/lnl/game/server/utils/{Tuple.java => Triplet.java} (86%) diff --git a/server/src/main/java/fr/lnl/game/server/utils/Cardinal.java b/server/src/main/java/fr/lnl/game/server/utils/Cardinal.java new file mode 100644 index 0000000..6d38b17 --- /dev/null +++ b/server/src/main/java/fr/lnl/game/server/utils/Cardinal.java @@ -0,0 +1,5 @@ +package fr.lnl.game.server.utils; + +public enum Cardinal { + NORTH,SOUTH,EAST,WEST,NORTH_EAST,NORTH_WEST,SOUTH_EAST,SOUTH_WEST +} diff --git a/server/src/main/java/fr/lnl/game/server/utils/Tuple.java b/server/src/main/java/fr/lnl/game/server/utils/Triplet.java similarity index 86% rename from server/src/main/java/fr/lnl/game/server/utils/Tuple.java rename to server/src/main/java/fr/lnl/game/server/utils/Triplet.java index 6e392ce..9459156 100644 --- a/server/src/main/java/fr/lnl/game/server/utils/Tuple.java +++ b/server/src/main/java/fr/lnl/game/server/utils/Triplet.java @@ -2,19 +2,19 @@ package fr.lnl.game.server.utils; import java.util.Objects; -public class Tuple { +public class Triplet { private A a; private B b; private C c; - public Tuple(A a, B b, C c){ + public Triplet(A a, B b, C c){ this.a = a; this.b = b; this.c = c; } - public Tuple(){ + public Triplet(){ this(null, null, null); } @@ -46,7 +46,7 @@ public class Tuple { public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - Tuple tuple = (Tuple) o; + Triplet tuple = (Triplet) o; return Objects.equals(a, tuple.a) && Objects.equals(b, tuple.b) && Objects.equals(c, tuple.c); }