diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/EntityID.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/EntityID.java index a06fbe4..c6eb5f1 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/EntityID.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/EntityID.java @@ -1,13 +1,19 @@ package uulm.teamname.marvelous.gamelibrary.entities; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import uulm.teamname.marvelous.gamelibrary.json.ingame.EntityIDDeserializer; + import java.util.Objects; /** Represents a distinct identification for every {@link Entity} in a game. */ +@JsonDeserialize(using = EntityIDDeserializer.class) public class EntityID { /** The index of the entity */ public final int id; /** The type of the entity */ + @JsonProperty("entityID") public final EntityType type; /** diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/Event.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/Event.java index c11c4cd..b1d8bdf 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/Event.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/Event.java @@ -1,10 +1,13 @@ package uulm.teamname.marvelous.gamelibrary.events; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import uulm.teamname.marvelous.gamelibrary.json.ingame.EventDeserializer; import uulm.teamname.marvelous.gamelibrary.json.ingame.MessageStructure; import java.util.Objects; /** Represents an abstract event sent inside a {@link MessageStructure} between client and server. */ +@JsonDeserialize(using = EventDeserializer.class) public abstract class Event { public EventType type;