Exemple #1
0
        public void TestMissReleaseAndHitSecondRelease()
        {
            var windows = new ManiaHitWindows();

            windows.SetDifficulty(10);

            var beatmap = new Beatmap <ManiaHitObject>
            {
                HitObjects =
                {
                    new HoldNote
                    {
                        StartTime = 1000,
                        Duration  = 500,
                        Column    = 0,
                    },
                    new HoldNote
                    {
                        StartTime = 1000 + 500 + windows.WindowFor(HitResult.Miss) + 10,
                        Duration  = 500,
                        Column    = 0,
                    },
                },
                BeatmapInfo =
                {
                    BaseDifficulty        = new BeatmapDifficulty
                    {
                        SliderTickRate    =  4,
                        OverallDifficulty = 10,
                    },
                    Ruleset               = new ManiaRuleset().RulesetInfo
                },
            };

            performTest(new List <ReplayFrame>
            {
                new ManiaReplayFrame(beatmap.HitObjects[1].StartTime, ManiaAction.Key1),
                new ManiaReplayFrame(beatmap.HitObjects[1].GetEndTime()),
            }, beatmap);

            AddAssert("first hold note missed", () => judgementResults.Where(j => beatmap.HitObjects[0].NestedHitObjects.Contains(j.HitObject))
                      .All(j => !j.Type.IsHit()));

            AddAssert("second hold note missed", () => judgementResults.Where(j => beatmap.HitObjects[1].NestedHitObjects.Contains(j.HitObject))
                      .All(j => j.Type.IsHit()));
        }
        protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate, double upTo = double.PositiveInfinity)
        {
            if (beatmap.HitObjects.Count == 0)
            {
                return new ManiaDifficultyAttributes {
                           Mods = mods, Skills = skills
                }
            }
            ;

            HitWindows hitWindows = new ManiaHitWindows();

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

            return(new ManiaDifficultyAttributes
            {
                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
            });
        }