Class AnimationJson
java.lang.Object
dev.kosmx.playerAnim.core.data.gson.AnimationJson
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<List<KeyframeAnimation>>,com.google.gson.JsonSerializer<KeyframeAnimation>
public class AnimationJson
extends Object
implements com.google.gson.JsonDeserializer<List<KeyframeAnimation>>, com.google.gson.JsonSerializer<KeyframeAnimation>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.gson.JsonElementdeserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) I think, we can stick with this legacy name:emotestatic com.google.gson.JsonObjectemoteSerializer(KeyframeAnimation emote) serialize an emote to json It won't be the same json file (not impossible) but multiple jsons can mean the same emote...static TypeDeprecated.static com.google.gson.JsonArraymoveSerializer(KeyframeAnimation emote) com.google.gson.JsonElementserialize(KeyframeAnimation emote, Type typeOfSrc, com.google.gson.JsonSerializationContext context) Animation to emotecraft format JSON tries to serialize extraData as long as it is string/number/bool/json.
-
Field Details
-
GSON
@Internal public static final com.google.gson.Gson GSON
-
-
Constructor Details
-
AnimationJson
public AnimationJson()
-
-
Method Details
-
getListedTypeToken
Deprecated.TypeToken helper for serializing- Returns:
- TypeToken for animation deserialization
-
deserialize
public List<KeyframeAnimation> deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException I think, we can stick with this legacy name:emote- Specified by:
deserializein interfacecom.google.gson.JsonDeserializer<List<KeyframeAnimation>>- Throws:
com.google.gson.JsonParseException
-
serialize
public com.google.gson.JsonElement serialize(KeyframeAnimation emote, Type typeOfSrc, com.google.gson.JsonSerializationContext context) Animation to emotecraft format JSON tries to serialize extraData as long as it is string/number/bool/json. *- Specified by:
serializein interfacecom.google.gson.JsonSerializer<KeyframeAnimation>- Parameters:
emote- source KeyframeAnimationtypeOfSrc- idkcontext- :)- Returns:
- :D Sorry for these really... useful comments
-
asJson
-
emoteSerializer
serialize an emote to json It won't be the same json file (not impossible) but multiple jsons can mean the same emote...Oh, and it's public and static, so you can call it from anywhere.
- Parameters:
emote- Emote to serialize- Returns:
- return Json object
-
moveSerializer
-