2021-04-29 14:45:18 +00:00
|
|
|
package uulm.teamname.marvelous.gamelibrary.json;
|
2021-04-29 14:40:35 +00:00
|
|
|
|
|
|
|
import jdk.jshell.spi.ExecutionControl;
|
2021-04-29 19:41:31 +00:00
|
|
|
import uulm.teamname.marvelous.gamelibrary.json.ingame.MessageStructure;
|
2021-04-29 14:40:35 +00:00
|
|
|
|
|
|
|
/** Contains JSON encoding and decoding.
|
|
|
|
*/
|
|
|
|
public class JSON {
|
|
|
|
/** Deserializes an incoming network message into a {@link MessageStructure}.
|
|
|
|
* @param input The JSON to deserialize.
|
2021-04-30 18:54:34 +00:00
|
|
|
* @return The parsed message. */
|
2021-04-29 14:40:35 +00:00
|
|
|
public static MessageStructure[] parse(String input) throws ExecutionControl.NotImplementedException {
|
|
|
|
//TODO: implement JSON.parse
|
|
|
|
throw new ExecutionControl.NotImplementedException("JSON.parse is not implemented");
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Serializes a {@link MessageStructure} into a JSON string.
|
|
|
|
* @param input The message to serialize.
|
2021-04-30 18:54:34 +00:00
|
|
|
* @return The message as JSON. */
|
2021-04-29 14:40:35 +00:00
|
|
|
public static String stringify(MessageStructure input) throws ExecutionControl.NotImplementedException {
|
|
|
|
//TODO: implement JSON.stringify
|
|
|
|
throw new ExecutionControl.NotImplementedException("JSON.stringify is not implemented");
|
|
|
|
}
|
|
|
|
}
|