コード例 #1
0
        private void load(OsuColour colours, BeatmapDifficultyCache difficultyCache)
        {
            Colour = colours.BlueLighter;

            if (gameplayState != null)
            {
                performanceCalculator = gameplayState.Ruleset.CreatePerformanceCalculator();
                clonedMods            = gameplayState.Mods.Select(m => m.DeepClone()).ToArray();

                scoreInfo = new ScoreInfo(gameplayState.Score.ScoreInfo.BeatmapInfo, gameplayState.Score.ScoreInfo.Ruleset)
                {
                    Mods = clonedMods
                };

                var gameplayWorkingBeatmap = new GameplayWorkingBeatmap(gameplayState.Beatmap);
                difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, clonedMods, loadCancellationSource.Token)
                .ContinueWith(task => Schedule(() =>
                {
                    timedAttributes = task.GetResultSafely();

                    IsValid = true;

                    if (lastJudgement != null)
                    {
                        onJudgementChanged(lastJudgement);
                    }
                }), TaskContinuationOptions.OnlyOnRanToCompletion);
            }
        }
コード例 #2
0
        private void load(OsuColour colours, BeatmapDifficultyCache difficultyCache)
        {
            Colour = colours.BlueLighter;

            if (gameplayState != null)
            {
                clonedMods = gameplayState.Mods.Select(m => m.DeepClone()).ToArray();

                var gameplayWorkingBeatmap = new GameplayWorkingBeatmap(gameplayState.Beatmap);
                difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, clonedMods, loadCancellationSource.Token)
                .ContinueWith(r => Schedule(() =>
                {
                    timedAttributes = r.Result;
                    IsValid         = true;
                    if (lastJudgement != null)
                    {
                        onJudgementChanged(lastJudgement);
                    }
                }), TaskContinuationOptions.OnlyOnRanToCompletion);
            }
        }