示例#1
0
        public MazebotSolverResponse(string sessionId, MazebotResponse maze, NavigationDetails solution, MazebotResult result)
        {
            MazeId           = Guid.NewGuid().ToString();
            SessionId        = sessionId;
            MazePath         = maze?.MazePath;
            DirectionsResult = result?.Result;
            Message          = result?.Message;
            Elapsed          = result?.Elapsed ?? 0;
            SolutionLength   = result != null ? $"{result.YourSolutionLength} (min: {result.ShortestSolutionLength})" : null;
            NextMaze         = result?.NextMaze;
            Certificate      = result?.Certificate;

            RawMaze     = JsonConvert.SerializeObject(maze, Formatting.None);
            RawSolution = JsonConvert.SerializeObject(solution, Formatting.None);
            RawResult   = JsonConvert.SerializeObject(result, Formatting.None);

            Maze     = maze;
            Solution = solution;
            Result   = result;
        }