diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneObjectMerging.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneObjectMerging.cs index 76982b05a7..dfe950c01e 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneObjectMerging.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneObjectMerging.cs @@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddAssert("slider created", () => { - if (circle1 is null || circle2 is null || slider is null) + if (circle1 == null || circle2 == null || slider == null) return false; var controlPoints = slider.Path.ControlPoints; @@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddAssert("slider created", () => { - if (slider1 is null || slider2 is null || slider1Path is null) + if (slider1 == null || slider2 == null || slider1Path == null) return false; var controlPoints1 = slider1Path.ControlPoints; @@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddAssert("slider end is at same completion for last slider", () => { - if (slider1Path is null || slider2 is null) + if (slider1Path == null || slider2 == null) return false; var mergedSlider = (Slider)EditorBeatmap.SelectedHitObjects.First(); @@ -256,7 +256,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddAssert("slider created", () => { - if (slider1 is null || slider2 is null || slider1Path is null) + if (slider1 == null || slider2 == null || slider1Path == null) return false; var controlPoints1 = slider1Path.ControlPoints; @@ -288,7 +288,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddAssert("slider end is at same completion for last slider", () => { - if (slider1Path is null || slider2 is null) + if (slider1Path == null || slider2 == null) return false; var mergedSlider = (Slider)EditorBeatmap.SelectedHitObjects.First(); @@ -322,7 +322,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddAssert("slider created", () => { - if (slider1 is null || slider2 is null || slider1Path is null) + if (slider1 == null || slider2 == null || slider1Path == null) return false; var controlPoints1 = slider1Path.ControlPoints; @@ -354,7 +354,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddAssert("slider end is at same completion for last slider", () => { - if (slider1Path is null || slider2 is null) + if (slider1Path == null || slider2 == null) return false; var mergedSlider = (Slider)EditorBeatmap.SelectedHitObjects.First(); diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderSplitting.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderSplitting.cs index 6c7733e68a..d68cbe6265 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderSplitting.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderSplitting.cs @@ -178,7 +178,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddStep("add hitsounds", () => { - if (slider is null) return; + if (slider == null) return; sample = new HitSampleInfo("hitwhistle", HitSampleInfo.BANK_SOFT, volume: 70); slider.Samples.Add(sample.With()); @@ -228,7 +228,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor { AddStep($"move mouse to control point {index}", () => { - if (slider is null || visualiser is null) return; + if (slider == null || visualiser == null) return; Vector2 position = slider.Path.ControlPoints[index].Position + slider.Position; InputManager.MoveMouseTo(visualiser.Pieces[0].Parent!.ToScreenSpace(position)); @@ -239,7 +239,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor { AddStep($"click context menu item \"{contextMenuText}\"", () => { - if (visualiser is null) return; + if (visualiser == null) return; MenuItem? item = visualiser.ContextMenuItems?.FirstOrDefault(menuItem => menuItem.Text.Value == contextMenuText); diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs index 4d2b980c23..2da462caf4 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs @@ -311,7 +311,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders foreach (var splitPoint in controlPointsToSplitAt) { - if (splitPoint == controlPoints[0] || splitPoint == controlPoints[^1] || splitPoint.Type is null) + if (splitPoint == controlPoints[0] || splitPoint == controlPoints[^1] || splitPoint.Type == null) continue; // Split off the section of slider before this control point so the remaining control points to split are in the latter part of the slider. diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 53c24dc828..3325cfe407 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -781,7 +781,7 @@ namespace osu.Game.Overlays.Mods /// > public bool OnPressed(KeyBindingPressEvent e) { - if (e.Repeat || e.Action != PlatformAction.SelectAll || SelectAllModsButton is null) + if (e.Repeat || e.Action != PlatformAction.SelectAll || SelectAllModsButton == null) return false; SelectAllModsButton.TriggerClick(); diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 283a59b7ed..66b3033f90 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -347,7 +347,7 @@ namespace osu.Game.Rulesets.Objects.Legacy // Edge-case rules (to match stable). if (type == PathType.PERFECT_CURVE) { - int endPointLength = endPoint is null ? 0 : 1; + int endPointLength = endPoint == null ? 0 : 1; if (vertices.Length + endPointLength != 3) type = PathType.BEZIER; diff --git a/osu.Game/Rulesets/Objects/PathControlPoint.cs b/osu.Game/Rulesets/Objects/PathControlPoint.cs index 1f8e63b269..32245e9080 100644 --- a/osu.Game/Rulesets/Objects/PathControlPoint.cs +++ b/osu.Game/Rulesets/Objects/PathControlPoint.cs @@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Objects public bool Equals(PathControlPoint other) => Position == other?.Position && Type == other.Type; - public override string ToString() => type is null + public override string ToString() => type == null ? $"Position={Position}" : $"Position={Position}, Type={type}"; } diff --git a/osu.Game/Rulesets/Objects/SliderPathExtensions.cs b/osu.Game/Rulesets/Objects/SliderPathExtensions.cs index 29b34ae4f0..c03d3646da 100644 --- a/osu.Game/Rulesets/Objects/SliderPathExtensions.cs +++ b/osu.Game/Rulesets/Objects/SliderPathExtensions.cs @@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Objects { var controlPoints = sliderPath.ControlPoints; - var inheritedLinearPoints = controlPoints.Where(p => sliderPath.PointsInSegment(p)[0].Type == PathType.LINEAR && p.Type is null).ToList(); + var inheritedLinearPoints = controlPoints.Where(p => sliderPath.PointsInSegment(p)[0].Type == PathType.LINEAR && p.Type == null).ToList(); // Inherited points after a linear point, as well as the first control point if it inherited, // should be treated as linear points, so their types are temporarily changed to linear. @@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Objects inheritedLinearPoints.ForEach(p => p.Type = null); // Recalculate middle perfect curve control points at the end of the slider path. - if (controlPoints.Count >= 3 && controlPoints[^3].Type == PathType.PERFECT_CURVE && controlPoints[^2].Type is null && segmentEnds.Any()) + if (controlPoints.Count >= 3 && controlPoints[^3].Type == PathType.PERFECT_CURVE && controlPoints[^2].Type == null && segmentEnds.Any()) { double lastSegmentStart = segmentEnds.Length > 1 ? segmentEnds[^2] : 0; double lastSegmentEnd = segmentEnds[^1]; diff --git a/osu.Game/Rulesets/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs index d1776c5c0b..5d9fafd60c 100644 --- a/osu.Game/Rulesets/UI/ModIcon.cs +++ b/osu.Game/Rulesets/UI/ModIcon.cs @@ -177,7 +177,7 @@ namespace osu.Game.Rulesets.UI modAcronym.Text = value.Acronym; modIcon.Icon = value.Icon ?? FontAwesome.Solid.Question; - if (value.Icon is null) + if (value.Icon == null) { modIcon.FadeOut(); modAcronym.FadeIn();