1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Apply NRT to FilterCriteria

This commit is contained in:
Dean Herbert 2023-06-26 17:28:08 +09:00
parent 6ec8ccda11
commit 14c95f4584
2 changed files with 8 additions and 12 deletions

View File

@ -210,7 +210,7 @@ namespace osu.Game.Tests.Visual.SongSelect
InputManager.Click(MouseButton.Left);
});
AddAssert("collection filter still selected", () => control.CreateCriteria().CollectionBeatmapMD5Hashes.Any());
AddAssert("collection filter still selected", () => control.CreateCriteria().CollectionBeatmapMD5Hashes?.Any() ?? false);
AddAssert("filter request not fired", () => !received);
}

View File

@ -1,12 +1,10 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
#nullable enable
// 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.
#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using osu.Game.Beatmaps;
using osu.Game.Collections;
using osu.Game.Rulesets;
@ -20,7 +18,7 @@ namespace osu.Game.Screens.Select
public GroupMode Group;
public SortMode Sort;
public BeatmapSetInfo SelectedBeatmapSet;
public BeatmapSetInfo? SelectedBeatmapSet;
public OptionalRange<double> StarDifficulty;
public OptionalRange<float> ApproachRate;
@ -42,10 +40,10 @@ namespace osu.Game.Screens.Select
public string[] SearchTerms = Array.Empty<string>();
public RulesetInfo Ruleset;
public RulesetInfo? Ruleset;
public bool AllowConvertedBeatmaps;
private string searchText;
private string searchText = string.Empty;
/// <summary>
/// <see cref="SearchText"/> as a number (if it can be parsed as one).
@ -70,11 +68,9 @@ namespace osu.Game.Screens.Select
/// <summary>
/// Hashes from the <see cref="BeatmapCollection"/> to filter to.
/// </summary>
[CanBeNull]
public IEnumerable<string> CollectionBeatmapMD5Hashes { get; set; }
public IEnumerable<string>? CollectionBeatmapMD5Hashes { get; set; }
[CanBeNull]
public IRulesetFilterCriteria RulesetCriteria { get; set; }
public IRulesetFilterCriteria? RulesetCriteria { get; set; }
public struct OptionalRange<T> : IEquatable<OptionalRange<T>>
where T : struct