1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Make OnlineStatus use OptionalRange

This commit is contained in:
smoogipoo 2019-09-19 17:12:07 +09:00
parent d7831d8f5d
commit 7683f7ff23
3 changed files with 4 additions and 5 deletions

View File

@ -37,7 +37,7 @@ namespace osu.Game.Screens.Select.Carousel
match &= criteria.BPM.IsInRange(Beatmap.BPM);
match &= criteria.BeatDivisor.IsInRange(Beatmap.BeatDivisor);
match &= !criteria.OnlineStatus.HasValue || criteria.OnlineStatus == Beatmap.Status;
match &= criteria.OnlineStatus.IsInRange(Beatmap.Status);
if (match)
foreach (var criteriaTerm in criteria.SearchTerms)

View File

@ -230,8 +230,8 @@ namespace osu.Game.Screens.Select
updateCriteriaRange(ref criteria.BeatDivisor, op, divisor);
break;
case "status" when op == ":" && Enum.TryParse<BeatmapSetOnlineStatus>(value, ignoreCase: true, out var statusValue):
criteria.OnlineStatus = statusValue;
case "status" when Enum.TryParse<BeatmapSetOnlineStatus>(value, true, out var statusValue):
updateCriteriaRange(ref criteria.OnlineStatus, op, statusValue);
break;
}

View File

@ -22,8 +22,7 @@ namespace osu.Game.Screens.Select
public OptionalRange<double> Length;
public OptionalRange<double> BPM;
public OptionalRange<int> BeatDivisor;
public BeatmapSetOnlineStatus? OnlineStatus;
public OptionalRange<BeatmapSetOnlineStatus> OnlineStatus;
public string[] SearchTerms = Array.Empty<string>();