Beispiel #1
0
        public static void DifficultyCheckForPrecalculation(Maze maze)
        {
            bool deadendsIncluded = false;
            bool endpointLocation = false;
            Guid mazeId           = maze.GetMazeId();
            int  difficulty       = maze.GetDifficulty();

            switch (difficulty)
            {
            case MASTERFUL_DIFFICULTY:
                deadendsIncluded = true;
                MemoryCacher.AddDomokunMoves(BreadthFirstSearchAlgorithm.BFSAlgorithm(maze, deadendsIncluded, endpointLocation), mazeId);
                break;

            case INHUMAN_DIFFICULTY:
                deadendsIncluded = true;
                endpointLocation = true;
                MemoryCacher.AddDomokunMoves(BreadthFirstSearchAlgorithm.BFSAlgorithm(maze, deadendsIncluded, endpointLocation), mazeId);
                break;

            case NIGHTMARE_DIFFICULTY:
                MemoryCacher.AddDomokunMoves(BreadthFirstSearchAlgorithm.BFSAlgorithm(maze, deadendsIncluded, endpointLocation), mazeId);
                break;

            case MASOCHISTIC_DIFFICULTY:
                MemoryCacher.AddDomokunMoves(BreadthFirstSearchAlgorithm.BFSAlgorithm(maze, deadendsIncluded, endpointLocation), mazeId);
                break;

            case GODLIKE_DIFFICULTY:
                endpointLocation = true;
                MemoryCacher.AddDomokunMoves(BreadthFirstSearchAlgorithm.BFSAlgorithm(maze, deadendsIncluded, endpointLocation), mazeId);
                break;

            default:
                break;
            }
        }