mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:07:25 +08:00
Make OnlineStatus use OptionalRange
This commit is contained in:
parent
d7831d8f5d
commit
7683f7ff23
@ -37,7 +37,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
match &= criteria.BPM.IsInRange(Beatmap.BPM);
|
match &= criteria.BPM.IsInRange(Beatmap.BPM);
|
||||||
|
|
||||||
match &= criteria.BeatDivisor.IsInRange(Beatmap.BeatDivisor);
|
match &= criteria.BeatDivisor.IsInRange(Beatmap.BeatDivisor);
|
||||||
match &= !criteria.OnlineStatus.HasValue || criteria.OnlineStatus == Beatmap.Status;
|
match &= criteria.OnlineStatus.IsInRange(Beatmap.Status);
|
||||||
|
|
||||||
if (match)
|
if (match)
|
||||||
foreach (var criteriaTerm in criteria.SearchTerms)
|
foreach (var criteriaTerm in criteria.SearchTerms)
|
||||||
|
@ -230,8 +230,8 @@ namespace osu.Game.Screens.Select
|
|||||||
updateCriteriaRange(ref criteria.BeatDivisor, op, 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 Enum.TryParse<BeatmapSetOnlineStatus>(value, true, out var statusValue):
|
||||||
criteria.OnlineStatus = statusValue;
|
updateCriteriaRange(ref criteria.OnlineStatus, op, statusValue);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,8 +22,7 @@ namespace osu.Game.Screens.Select
|
|||||||
public OptionalRange<double> Length;
|
public OptionalRange<double> Length;
|
||||||
public OptionalRange<double> BPM;
|
public OptionalRange<double> BPM;
|
||||||
public OptionalRange<int> BeatDivisor;
|
public OptionalRange<int> BeatDivisor;
|
||||||
|
public OptionalRange<BeatmapSetOnlineStatus> OnlineStatus;
|
||||||
public BeatmapSetOnlineStatus? OnlineStatus;
|
|
||||||
|
|
||||||
public string[] SearchTerms = Array.Empty<string>();
|
public string[] SearchTerms = Array.Empty<string>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user