From f3d3310e46bc062825aab3877cad57f32713d127 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Thu, 3 Jun 2021 16:36:40 +0200 Subject: [PATCH] fix: made Event/Request/ReconnectMessage subclasses of BasicMessage --- .../marvelous/gamelibrary/messages/EventMessage.java | 5 +---- .../marvelous/gamelibrary/messages/ReconnectMessage.java | 2 +- .../marvelous/gamelibrary/messages/RequestMessage.java | 5 +---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/EventMessage.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/EventMessage.java index d10474b..e06968a 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/EventMessage.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/EventMessage.java @@ -8,10 +8,7 @@ import java.util.HashMap; import java.util.Objects; /** Represents a message sent between client and server and contains all possible data. */ -public class EventMessage { - - /** This is the message type. It is either REQUESTS or EVENTS, everything else would be invalid here */ - public MessageType messageType; +public class EventMessage extends BasicMessage { /** The list of {@link Event Events} sent inside the message. */ public Event[] messages; diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/ReconnectMessage.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/ReconnectMessage.java index a6c745c..cd9f354 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/ReconnectMessage.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/ReconnectMessage.java @@ -1,6 +1,6 @@ package uulm.teamname.marvelous.gamelibrary.messages; -public class ReconnectMessage { +public class ReconnectMessage extends BasicMessage { /** Whether the client wants to reconnect to the previously running game */ public Boolean reconnect; diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/RequestMessage.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/RequestMessage.java index a1c094a..73777ca 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/RequestMessage.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/RequestMessage.java @@ -9,10 +9,7 @@ import java.util.HashMap; import java.util.Objects; /** Represents a message sent between client and server and contains all possible data. */ -public class RequestMessage { - - /** This is the message type. It is either REQUESTS or EVENTS, everything else would be invalid here */ - public MessageType messageType; +public class RequestMessage extends BasicMessage { /** The list of {@link Event Events} sent inside the message. */ public Request[] messages;