示例#1
0
        protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
        {
            // Only karaoke note can be apply in difficulty calculation
            var notes = beatmap.HitObjects.OfType <Note>().ToList();

            if (!notes.Any())
            {
                return new KaraokeDifficultyAttributes {
                           Mods = mods, Skills = skills
                }
            }
            ;

            HitWindows hitWindows = new KaraokeHitWindows();

            hitWindows.SetDifficulty(beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty);

            return(new KaraokeDifficultyAttributes
            {
                StarRating = difficultyValue(skills) * star_scaling_factor,
                Mods = mods,
                // Todo: This int cast is temporary to achieve 1:1 results with osu!stable, and should be removed in the future
                GreatHitWindow = (int)hitWindows.WindowFor(HitResult.Great) / clockRate,
                Skills = skills
            });
        }
        protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
        {
            if (beatmap.HitObjects.Count == 0)
            {
                return new KaraokeDifficultyAttributes {
                           Mods = mods, Skills = skills
                }
            }
            ;

            HitWindows hitWindows = new KaraokeHitWindows();

            hitWindows.SetDifficulty(beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty);

            return(new KaraokeDifficultyAttributes
            {
                StarRating = skills[0].DifficultyValue() * star_scaling_factor,
                Mods = mods,
                // Todo: This int cast is temporary to achieve 1:1 results with osu!stable, and should be removed in the future
                GreatHitWindow = (int)hitWindows.WindowFor(HitResult.Great) / clockRate,
                Skills = skills
            });
        }