1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-27 21:43:01 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs

41 lines
1.4 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-05-11 14:31:12 +08:00
using System.Collections.Generic;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
2018-05-11 14:31:12 +08:00
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Objects
2018-05-11 14:31:12 +08:00
{
public class TaikoHitWindows : HitWindows
2018-05-11 14:31:12 +08:00
{
private static readonly IReadOnlyDictionary<HitResult, (double od0, double od5, double od10)> base_ranges = new Dictionary<HitResult, (double, double, double)>
{
{ HitResult.Great, (100, 70, 40) },
{ HitResult.Good, (240, 160, 100) },
2018-12-06 20:04:54 +08:00
{ HitResult.Miss, (270, 190, 140) },
2018-05-11 14:31:12 +08:00
};
2018-12-06 20:04:54 +08:00
public override bool IsHitResultAllowed(HitResult result)
{
switch (result)
{
case HitResult.Great:
case HitResult.Good:
case HitResult.Miss:
return true;
default:
return false;
}
}
2018-05-11 14:31:12 +08:00
public override void SetDifficulty(double difficulty)
{
Great = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Great]);
Good = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Good]);
Miss = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Miss]);
}
}
}