feat: added JsonSerializer to Event

This commit is contained in:
Yannik Bretschneider 2021-06-02 16:28:42 +02:00
parent ea3d51c408
commit b9bf930d6c

View File

@ -1,13 +1,16 @@
package uulm.teamname.marvelous.gamelibrary.events; package uulm.teamname.marvelous.gamelibrary.events;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import uulm.teamname.marvelous.gamelibrary.json.basic.EventMessage; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import uulm.teamname.marvelous.gamelibrary.messages.EventMessage;
import uulm.teamname.marvelous.gamelibrary.json.ingame.deserialize.EventDeserializer; import uulm.teamname.marvelous.gamelibrary.json.ingame.deserialize.EventDeserializer;
import uulm.teamname.marvelous.gamelibrary.json.ingame.serialize.EventSerializer;
import java.util.Objects; import java.util.Objects;
/** Represents an abstract event sent inside a {@link EventMessage} between client and server. */ /** Represents an abstract event sent inside a {@link EventMessage} between client and server. */
@JsonDeserialize(using = EventDeserializer.class) @JsonDeserialize(using = EventDeserializer.class)
@JsonSerialize(using = EventSerializer.class)
public abstract class Event { public abstract class Event {
public EventType type; public EventType type;