1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:22:56 +08:00

Make BeatDivisor use OptionalRange

This commit is contained in:
smoogipoo 2019-09-19 16:53:27 +09:00
parent 3c21b68b73
commit 0915a94470
3 changed files with 4 additions and 5 deletions

View File

@ -36,7 +36,7 @@ namespace osu.Game.Screens.Select.Carousel
match &= criteria.Length.IsInRange(Beatmap.Length); match &= criteria.Length.IsInRange(Beatmap.Length);
match &= criteria.BPM.IsInRange(Beatmap.BPM); match &= criteria.BPM.IsInRange(Beatmap.BPM);
match &= !criteria.BeatDivisor.HasValue || criteria.BeatDivisor == Beatmap.BeatDivisor; match &= criteria.BeatDivisor.IsInRange(Beatmap.BeatDivisor);
match &= !criteria.OnlineStatus.HasValue || criteria.OnlineStatus == Beatmap.Status; match &= !criteria.OnlineStatus.HasValue || criteria.OnlineStatus == Beatmap.Status;
if (match) if (match)

View File

@ -226,8 +226,8 @@ namespace osu.Game.Screens.Select
updateCriteriaRange(ref criteria.Length, op, length * scale, scale / 2.0); updateCriteriaRange(ref criteria.Length, op, length * scale, scale / 2.0);
break; break;
case "divisor" when op == ":" && int.TryParse(value, out var divisor): case "divisor" when int.TryParse(value, out var divisor):
criteria.BeatDivisor = divisor; updateCriteriaRange(ref criteria.BeatDivisor, op, divisor);
break; break;
case "status" when op == ":" && Enum.TryParse<BeatmapSetOnlineStatus>(value, ignoreCase: true, out var statusValue): case "status" when op == ":" && Enum.TryParse<BeatmapSetOnlineStatus>(value, ignoreCase: true, out var statusValue):

View File

@ -20,8 +20,7 @@ namespace osu.Game.Screens.Select
public OptionalRange<float> CircleSize; public OptionalRange<float> CircleSize;
public OptionalRange<double> Length; public OptionalRange<double> Length;
public OptionalRange<double> BPM; public OptionalRange<double> BPM;
public OptionalRange<int> BeatDivisor;
public int? BeatDivisor;
public BeatmapSetOnlineStatus? OnlineStatus; public BeatmapSetOnlineStatus? OnlineStatus;