From b8e13f295c1b11ffe0095d3e29ba5130fa3f2131 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Thu, 3 Jun 2021 17:48:38 +0200 Subject: [PATCH] fix: fixed wrong Variable type in GameAssignmentMessage --- .../messages/GameAssignmentMessage.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/GameAssignmentMessage.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/GameAssignmentMessage.java index a5e6a4c..92e6cbc 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/GameAssignmentMessage.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/GameAssignmentMessage.java @@ -1,6 +1,10 @@ package uulm.teamname.marvelous.gamelibrary.messages; import uulm.teamname.marvelous.gamelibrary.config.CharacterConfig; +import uulm.teamname.marvelous.gamelibrary.config.CharacterProperties; + +import java.util.Arrays; +import java.util.Objects; public class GameAssignmentMessage extends BasicMessage { @@ -8,5 +12,21 @@ public class GameAssignmentMessage extends BasicMessage { public String gameID; /** The characters the player can choose from */ - public CharacterConfig[] characterSelection; + public CharacterProperties[] characterSelection; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + GameAssignmentMessage that = (GameAssignmentMessage) o; + return Objects.equals(gameID, that.gameID) && Arrays.equals(characterSelection, that.characterSelection); + } + + @Override + public int hashCode() { + int result = Objects.hash(super.hashCode(), gameID); + result = 31 * result + Arrays.hashCode(characterSelection); + return result; + } }