Пример #1
0
        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);
        }
Пример #2
0
        public static string serialize(Game game)
        {
            GameRepresentation grep = new GameRepresentation(game.GameBoard, game.PlayerStats);

            return(serialize(grep));
        }
Пример #3
0
        public static string serialize(GameRepresentation grep)
        {
            string json_game = JsonUtility.ToJson(grep);

            return(json_game);
        }