feat: connected deserializers to classes

This commit is contained in:
Yannik Bretschneider 2021-05-11 06:14:43 +02:00
parent 6947105077
commit f09b9e2388
2 changed files with 9 additions and 0 deletions

View File

@ -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;
/**

View File

@ -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;