private static GridBoard ParseJsonGridBoard(JObject jState, int width, int height)
        {
            string gridString = jState.GetValue(Fields.board).ToString();

            int[,] grid = JsonConvert.DeserializeObject <int[, ]>(gridString);
            grid        = GridBoard.Transpose(grid, height, width); // Received as [y, x], we want [x, y]
            return(new GridBoard(width, height, grid));
        }
        internal static string CreateCommandEvaluateBoard(GridBoard board)
        {
            JObject jsonCommand = new JObject(
                new JProperty(Fields.action, Actions.evalBoard),
                //new JProperty(Fields.board, board.Serialize())
                new JProperty(Fields.board, JArray.FromObject(GridBoard.Transpose(board.grid, board.WIDTH, board.HEIGHT)))
                );

            //Console.WriteLine("Command evaluate: \n" + jsonCommand.ToString() + "\n");
            return(jsonCommand.ToString());
        }
        internal static string CreateCommandSimulateMove(GridBoard board, int player, int move)
        {
            JObject jsonCommand = new JObject(
                new JProperty(Fields.action, Actions.simMove),
                //new JProperty(Fields.board, board.Serialize()),
                new JProperty(Fields.board, JArray.FromObject(GridBoard.Transpose(board.grid, board.WIDTH, board.HEIGHT))),
                new JProperty(Fields.player, player),
                new JProperty(Fields.move, move)
                );

            //Console.WriteLine("Command simMove: \n" + jsonCommand.ToString() + "\n");
            return(jsonCommand.ToString());
        }