public static GameRepresentation deserialize(string json_game) { GameRepresentation game = JsonUtility.FromJson <GameRepresentation>(json_game); // allow the game board to reconstruct some information game.board.OnSerializeFinished(); return(game); }
public static string serialize(Game game) { GameRepresentation grep = new GameRepresentation(game.GameBoard, game.PlayerStats); return(serialize(grep)); }
public static string serialize(GameRepresentation grep) { string json_game = JsonUtility.ToJson(grep); return(json_game); }