private void GenerateMaze()
        {
            var stopwatch = Stopwatch.StartNew();
            var maze      = CreateMaze();

            stopwatch.Stop();

            var stats = new MazeStats(maze, _mazeConfigWindow.SelectedWallSetupAlgorithm);

            stats.AddCustomStat("Generation Time", $"{stopwatch.ElapsedMilliseconds}ms");

            _mazeRenderer.LoadMaze(maze, stats);
            _mazeConfigWindow.SetMazeStats(stats.Entries);
        }
Exemple #2
0
        private void UpdateMazeRendering()
        {
            if (_currentMaze == null)
            {
                return;
            }

            var stopwatch = Stopwatch.StartNew();

            using (var image = GetImageForCurrentMaze())
            {
                _currentMazeTexture = MonoGameUtils.RenderImageToTexture2D(image, _graphicsDevice);
            }

            stopwatch.Stop();
            _currentStats.AddCustomStat(RenderTimeStatKey, $"{stopwatch.ElapsedMilliseconds}ms");
        }