mirror of
https://github.com/SK-la/Ez2Lazer.git
synced 2026-03-13 11:20:28 +00:00
Apply new inspections from 2026.1EAP1
Nothing really egregious here so not bothering with PR review. One dodgy bug which has been [reported](https://youtrack.jetbrains.com/issue/RIDER-135036/Incorrect-recursive-on-all-execution-paths-inspection) and temporarily ignored.
This commit is contained in:
@@ -207,7 +207,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
var hitWindows = new ManiaHitWindows();
|
||||
|
||||
AddInternal(judgementPooler = new JudgementPooler<DrawableManiaJudgement>(Enum.GetValues<HitResult>().Where(r => hitWindows.IsHitResultAllowed(r))));
|
||||
AddInternal(judgementPooler = new JudgementPooler<DrawableManiaJudgement>(Enum.GetValues<HitResult>().Where(hitWindows.IsHitResultAllowed)));
|
||||
|
||||
RegisterPool<BarLine, DrawableBarLine>(50, 200);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
Debug.Assert(drawableHitObject.HitObject.HitWindows != null);
|
||||
|
||||
double delay = drawableHitObject.HitObject.StartTime - (drawableHitObject.HitObject.HitWindows.WindowFor(HitResult.Miss) + RNG.Next(0, 300)) - Time.Current;
|
||||
scheduledTasks.Add(Scheduler.AddDelayed(() => drawableHitObject.TriggerJudgement(), delay));
|
||||
scheduledTasks.Add(Scheduler.AddDelayed(drawableHitObject.TriggerJudgement, delay));
|
||||
|
||||
return drawableHitObject;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
|
||||
var hitWindows = new TaikoHitWindows();
|
||||
|
||||
HitResult[] usableHitResults = Enum.GetValues<HitResult>().Where(r => hitWindows.IsHitResultAllowed(r)).ToArray();
|
||||
HitResult[] usableHitResults = Enum.GetValues<HitResult>().Where(hitWindows.IsHitResultAllowed).ToArray();
|
||||
|
||||
AddInternal(judgementPooler = new JudgementPooler<DrawableTaikoJudgement>(usableHitResults));
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
|
||||
AddStep("change all start times", () =>
|
||||
{
|
||||
editorBeatmap.HitObjectUpdated += h => updatedObjects.Add(h);
|
||||
editorBeatmap.HitObjectUpdated += updatedObjects.Add;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
allHitObjects[i].StartTime += 10;
|
||||
@@ -282,7 +282,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
|
||||
AddStep("change start time twice", () =>
|
||||
{
|
||||
editorBeatmap.HitObjectUpdated += h => updatedObjects.Add(h);
|
||||
editorBeatmap.HitObjectUpdated += updatedObjects.Add;
|
||||
|
||||
editorBeatmap.HitObjects[0].StartTime = 10;
|
||||
editorBeatmap.HitObjects[0].StartTime = 20;
|
||||
|
||||
@@ -104,10 +104,7 @@ namespace osu.Game.Tests.Database
|
||||
Assert.AreNotEqual(detachedBeatmapSet.Status, BeatmapOnlineStatus.Ranked);
|
||||
detachedBeatmapSet.Status = BeatmapOnlineStatus.Ranked;
|
||||
|
||||
beatmapSet.PerformWrite(s =>
|
||||
{
|
||||
detachedBeatmapSet.CopyChangesToRealm(s);
|
||||
});
|
||||
beatmapSet.PerformWrite(detachedBeatmapSet.CopyChangesToRealm);
|
||||
|
||||
beatmapSet.PerformRead(s =>
|
||||
{
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
List<SkinBlueprint> blueprints = new List<SkinBlueprint>();
|
||||
|
||||
AddStep("clear list", () => blueprints.Clear());
|
||||
AddStep("clear list", blueprints.Clear);
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
|
||||
@@ -197,15 +197,15 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
AddUntilStep("favourites count is 2345", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single().Text.ToString(), () => Is.EqualTo("2,345"));
|
||||
|
||||
AddStep("click favourite button", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single().TriggerClick());
|
||||
AddStep("allow request to complete", () => resetEvent.Set());
|
||||
AddStep("allow request to complete", resetEvent.Set);
|
||||
AddUntilStep("favourites count is 2346", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single().Text.ToString(), () => Is.EqualTo("2,346"));
|
||||
|
||||
AddStep("reset event", () => resetEvent.Reset());
|
||||
AddStep("reset event", resetEvent.Reset);
|
||||
AddStep("click favourite button", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single().TriggerClick());
|
||||
AddStep("allow request to complete", () => resetEvent.Set());
|
||||
AddStep("allow request to complete", resetEvent.Set);
|
||||
AddUntilStep("favourites count is 2345", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single().Text.ToString(), () => Is.EqualTo("2,345"));
|
||||
|
||||
AddStep("reset event", () => resetEvent.Reset());
|
||||
AddStep("reset event", resetEvent.Reset);
|
||||
AddStep("click favourite button", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single().TriggerClick());
|
||||
AddStep("change to another beatmap", () =>
|
||||
{
|
||||
@@ -217,7 +217,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
Beatmap.Value = working;
|
||||
onlineLookupResult.Value = online;
|
||||
});
|
||||
AddStep("allow request to complete", () => resetEvent.Set());
|
||||
AddStep("allow request to complete", resetEvent.Set);
|
||||
AddUntilStep("favourites count is 9999", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single().Text.ToString(), () => Is.EqualTo("9,999"));
|
||||
|
||||
AddStep("set up request handler to fail", () =>
|
||||
@@ -239,11 +239,11 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
}
|
||||
};
|
||||
});
|
||||
AddStep("reset event", () => resetEvent.Reset());
|
||||
AddStep("reset event", resetEvent.Reset);
|
||||
AddStep("click favourite button", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single().TriggerClick());
|
||||
AddAssert("spinner visible", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single()
|
||||
.ChildrenOfType<LoadingSpinner>().Single().State.Value, () => Is.EqualTo(Visibility.Visible));
|
||||
AddStep("allow request to complete", () => resetEvent.Set());
|
||||
AddStep("allow request to complete", resetEvent.Set);
|
||||
AddAssert("spinner hidden", () => this.ChildrenOfType<BeatmapTitleWedge.FavouriteButton>().Single()
|
||||
.ChildrenOfType<LoadingSpinner>().Single().State.Value, () => Is.EqualTo(Visibility.Hidden));
|
||||
}
|
||||
|
||||
@@ -40,20 +40,20 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
firedText
|
||||
};
|
||||
|
||||
AddStep("start confirming", () => overlay.Begin());
|
||||
AddStep("abort confirming", () => overlay.Abort());
|
||||
AddStep("start confirming", overlay.Begin);
|
||||
AddStep("abort confirming", overlay.Abort);
|
||||
|
||||
AddAssert("ensure not fired internally", () => !overlay.Fired);
|
||||
AddAssert("ensure aborted", () => !fired);
|
||||
|
||||
AddStep("start confirming", () => overlay.Begin());
|
||||
AddStep("start confirming", overlay.Begin);
|
||||
|
||||
AddUntilStep("wait until confirmed", () => fired);
|
||||
AddAssert("ensure fired internally", () => overlay.Fired);
|
||||
|
||||
AddStep("abort after fire", () => overlay.Abort());
|
||||
AddStep("abort after fire", overlay.Abort);
|
||||
AddAssert("ensure not fired internally", () => !overlay.Fired);
|
||||
AddStep("start confirming", () => overlay.Begin());
|
||||
AddStep("start confirming", overlay.Begin);
|
||||
AddUntilStep("wait until fired again", () => overlay.Fired);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,9 +133,9 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
var loadedBackgrounds = backgrounds.Where(b => b.ContentLoaded);
|
||||
|
||||
AddUntilStep("some loaded", () => loadedBackgrounds.Any());
|
||||
AddUntilStep("some loaded", loadedBackgrounds.Any);
|
||||
AddStep("scroll to bottom", () => scrollContainer.ScrollToEnd());
|
||||
AddUntilStep("all unloaded", () => !loadedBackgrounds.Any());
|
||||
AddUntilStep("all unloaded", loadedBackgrounds.Any, () => Is.False);
|
||||
}
|
||||
|
||||
private partial class TestUpdateableBeatmapBackgroundSprite : UpdateableBeatmapBackgroundSprite
|
||||
|
||||
@@ -89,9 +89,9 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
var loadedCovers = covers.Where(c => c.ChildrenOfType<OnlineBeatmapSetCover>().SingleOrDefault()?.IsLoaded ?? false);
|
||||
|
||||
AddUntilStep("some loaded", () => loadedCovers.Any());
|
||||
AddUntilStep("some loaded", loadedCovers.Any);
|
||||
AddStep("scroll to end", () => scroll.ScrollToEnd());
|
||||
AddUntilStep("all unloaded", () => !loadedCovers.Any());
|
||||
AddUntilStep("all unloaded", loadedCovers.Any, () => Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
Width = 0.2f,
|
||||
Margin = new MarginPadding(10),
|
||||
Text = "Add beatmap",
|
||||
Action = () => beatmapEditor.CreateNew()
|
||||
Action = beatmapEditor.CreateNew
|
||||
},
|
||||
beatmapEditor
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
Width = 0.2f,
|
||||
Margin = new MarginPadding(10),
|
||||
Text = "Add beatmap",
|
||||
Action = () => beatmapEditor.CreateNew()
|
||||
Action = beatmapEditor.CreateNew
|
||||
},
|
||||
beatmapEditor
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
new SettingsButton
|
||||
{
|
||||
Text = "Add player",
|
||||
Action = () => playerEditor.CreateNew()
|
||||
Action = playerEditor.CreateNew
|
||||
},
|
||||
new Container
|
||||
{
|
||||
|
||||
@@ -170,21 +170,21 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
SampleControlPoint sampleControlPoint = (beatmap.ControlPointInfo as LegacyControlPointInfo)?.SamplePointAt(hitObject.StartTime + CONTROL_POINT_LENIENCY + 1)
|
||||
?? SampleControlPoint.DEFAULT;
|
||||
hitObject.Samples = hitObject.Samples.Select(o => sampleControlPoint.ApplyTo(o)).ToList();
|
||||
hitObject.Samples = hitObject.Samples.Select(sampleControlPoint.ApplyTo).ToList();
|
||||
|
||||
for (int i = 0; i < hasRepeats.NodeSamples.Count; i++)
|
||||
{
|
||||
double time = hitObject.StartTime + i * hasRepeats.Duration / hasRepeats.SpanCount() + CONTROL_POINT_LENIENCY;
|
||||
var nodeSamplePoint = (beatmap.ControlPointInfo as LegacyControlPointInfo)?.SamplePointAt(time) ?? SampleControlPoint.DEFAULT;
|
||||
|
||||
hasRepeats.NodeSamples[i] = hasRepeats.NodeSamples[i].Select(o => nodeSamplePoint.ApplyTo(o)).ToList();
|
||||
hasRepeats.NodeSamples[i] = hasRepeats.NodeSamples[i].Select(nodeSamplePoint.ApplyTo).ToList();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SampleControlPoint sampleControlPoint = (beatmap.ControlPointInfo as LegacyControlPointInfo)?.SamplePointAt(hitObject.GetEndTime() + CONTROL_POINT_LENIENCY)
|
||||
?? SampleControlPoint.DEFAULT;
|
||||
hitObject.Samples = hitObject.Samples.Select(o => sampleControlPoint.ApplyTo(o)).ToList();
|
||||
hitObject.Samples = hitObject.Samples.Select(sampleControlPoint.ApplyTo).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
IDisposable duckOperation = Duck(parameters);
|
||||
|
||||
Scheduler.AddDelayed(() => duckOperation.Dispose(), delayUntilRestore);
|
||||
Scheduler.AddDelayed(duckOperation.Dispose, delayUntilRestore);
|
||||
}
|
||||
|
||||
private bool next(bool allowProtectedTracks)
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace osu.Game.Overlays.SkinEditor
|
||||
mods.Value = mods.Value.Except(invalid).ToArray();
|
||||
|
||||
if (replayGeneratingMod != null)
|
||||
screen.Push(new EndlessPlayer((beatmap, mods) => replayGeneratingMod.CreateScoreFromReplayData(beatmap, mods)));
|
||||
screen.Push(new EndlessPlayer(replayGeneratingMod.CreateScoreFromReplayData));
|
||||
}, new[] { typeof(Player), typeof(SoloSongSelect) });
|
||||
}
|
||||
|
||||
|
||||
@@ -170,6 +170,7 @@ namespace osu.Game.Screens.Footer
|
||||
/// <summary>
|
||||
/// The screen which should be bound to the screen footer - the most nested subscreen.
|
||||
/// </summary>
|
||||
// ReSharper disable once FunctionRecursiveOnAllPaths (TODO: remove after fixed https://youtrack.jetbrains.com/issue/RIDER-135036/Incorrect-recursive-on-all-execution-paths-inspection)
|
||||
private IScreen leadingScreen => subScreenTracker?.leadingScreen ?? stack.CurrentScreen;
|
||||
|
||||
public ScreenStackTracker(ScreenStack stack)
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace osu.Game.Screens.Menu
|
||||
return;
|
||||
|
||||
var request = new GetMenuContentRequest();
|
||||
Task.Run(() => request.Perform())
|
||||
Task.Run(request.Perform)
|
||||
.ContinueWith(r =>
|
||||
{
|
||||
if (!FetchOnlineContent)
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.RoundResults
|
||||
|
||||
var request = new IndexPlaylistScoresRequest(client.Room.RoomID, client.Room.Settings.PlaylistItemId);
|
||||
request.Success += req => scoreTask.SetResult(req.Scores);
|
||||
request.Failure += e => scoreTask.SetException(e);
|
||||
request.Failure += scoreTask.SetException;
|
||||
api.Queue(request);
|
||||
|
||||
await Task.WhenAll(beatmapTask, scoreTask.Task).ConfigureAwait(false);
|
||||
|
||||
@@ -398,7 +398,7 @@ namespace osu.Game.Screens.Ranking
|
||||
}
|
||||
|
||||
// allow a frame for scroll container to adjust its dimensions with the added scores before fetching again.
|
||||
Schedule(() => tcs.SetResult());
|
||||
Schedule(tcs.SetResult);
|
||||
|
||||
if (ScorePanelList.IsEmpty)
|
||||
{
|
||||
|
||||
@@ -528,7 +528,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
if (!notYetVisitedSets.Any())
|
||||
{
|
||||
previouslyVisitedRandomSets.RemoveAll(s => visibleSets.Contains(s));
|
||||
previouslyVisitedRandomSets.RemoveAll(visibleSets.Contains);
|
||||
notYetVisitedSets = visibleSets;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
var request = new GetBeatmapSetRequest(id);
|
||||
var tcs = new TaskCompletionSource<APIBeatmapSet?>();
|
||||
|
||||
token.Register(() => request.Cancel());
|
||||
token.Register(request.Cancel);
|
||||
|
||||
// async request success callback is a bit of a dangerous game, but there's some reasoning for it.
|
||||
// - don't really want to use `IAPIAccess.PerformAsync()` because we still want to respect request queueing & online status checks
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
if (replayGeneratingMod != null)
|
||||
{
|
||||
player = new ReplayPlayer((beatmap, mods) => replayGeneratingMod.CreateScoreFromReplayData(beatmap, mods));
|
||||
player = new ReplayPlayer(replayGeneratingMod.CreateScoreFromReplayData);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user