fix: made Event/Request/ReconnectMessage subclasses of BasicMessage

This commit is contained in:
Yannik Bretschneider 2021-06-03 16:36:40 +02:00
parent dbc7264d5f
commit f3d3310e46
3 changed files with 3 additions and 9 deletions

View File

@ -8,10 +8,7 @@ import java.util.HashMap;
import java.util.Objects; import java.util.Objects;
/** Represents a message sent between client and server and contains all possible data. */ /** Represents a message sent between client and server and contains all possible data. */
public class EventMessage { public class EventMessage extends BasicMessage {
/** This is the message type. It is either REQUESTS or EVENTS, everything else would be invalid here */
public MessageType messageType;
/** The list of {@link Event Events} sent inside the message. */ /** The list of {@link Event Events} sent inside the message. */
public Event[] messages; public Event[] messages;

View File

@ -1,6 +1,6 @@
package uulm.teamname.marvelous.gamelibrary.messages; 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 */ /** Whether the client wants to reconnect to the previously running game */
public Boolean reconnect; public Boolean reconnect;

View File

@ -9,10 +9,7 @@ import java.util.HashMap;
import java.util.Objects; import java.util.Objects;
/** Represents a message sent between client and server and contains all possible data. */ /** Represents a message sent between client and server and contains all possible data. */
public class RequestMessage { public class RequestMessage extends BasicMessage {
/** This is the message type. It is either REQUESTS or EVENTS, everything else would be invalid here */
public MessageType messageType;
/** The list of {@link Event Events} sent inside the message. */ /** The list of {@link Event Events} sent inside the message. */
public Request[] messages; public Request[] messages;