From a289fee059336172fd050f7afc98bf32e158ea8e Mon Sep 17 00:00:00 2001 From: punchready Date: Thu, 1 Jul 2021 11:28:01 +0200 Subject: [PATCH] fix: use own methods in JSON constructor and add javadoc --- .../uulm/teamname/marvelous/gamelibrary/json/JSON.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java index 1cc8fff..34ad890 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java @@ -94,10 +94,7 @@ public class JSON { private final ObjectMapper mapper = new ObjectMapper(); public JSON (CharacterConfig config) { - // add the config to the mappers InjectableValues, where it is later accessed by the EntityDeserializer - this.mapper.setInjectableValues(new InjectableValues - .Std() - .addValue("CharacterConfig", config)); + setCharacterConfig(config); } /** Deserializes an incoming network message into a {@link EventMessage}. @@ -132,6 +129,9 @@ public class JSON { } } + /** + * Sets the {@link CharacterConfig} to be used during deserialization of Entities. + */ public void setCharacterConfig(CharacterConfig config) { this.mapper.setInjectableValues(new InjectableValues .Std()