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

Update parameter discards

This commit is contained in:
Dean Herbert 2022-06-24 21:25:23 +09:00
parent 30eebf3511
commit 31a447fda0
182 changed files with 309 additions and 309 deletions

View File

@ -57,7 +57,7 @@ namespace osu.Desktop
client.OnReady += onReady; client.OnReady += onReady;
// safety measure for now, until we performance test / improve backoff for failed connections. // safety measure for now, until we performance test / improve backoff for failed connections.
client.OnConnectionFailed += (_, __) => client.Deinitialize(); client.OnConnectionFailed += (_, _) => client.Deinitialize();
client.OnError += (_, e) => Logger.Log($"An error occurred with Discord RPC Client: {e.Code} {e.Message}", LoggingTarget.Network); client.OnError += (_, e) => Logger.Log($"An error occurred with Discord RPC Client: {e.Code} {e.Message}", LoggingTarget.Network);

View File

@ -129,18 +129,18 @@ namespace osu.Desktop
[SupportedOSPlatform("windows")] [SupportedOSPlatform("windows")]
private static void setupSquirrel() private static void setupSquirrel()
{ {
SquirrelAwareApp.HandleEvents(onInitialInstall: (version, tools) => SquirrelAwareApp.HandleEvents(onInitialInstall: (_, tools) =>
{ {
tools.CreateShortcutForThisExe(); tools.CreateShortcutForThisExe();
tools.CreateUninstallerRegistryEntry(); tools.CreateUninstallerRegistryEntry();
}, onAppUpdate: (version, tools) => }, onAppUpdate: (_, tools) =>
{ {
tools.CreateUninstallerRegistryEntry(); tools.CreateUninstallerRegistryEntry();
}, onAppUninstall: (version, tools) => }, onAppUninstall: (_, tools) =>
{ {
tools.RemoveShortcutForThisExe(); tools.RemoveShortcutForThisExe();
tools.RemoveUninstallerRegistryEntry(); tools.RemoveUninstallerRegistryEntry();
}, onEveryRun: (version, tools, firstRun) => }, onEveryRun: (_, _, _) =>
{ {
// While setting the `ProcessAppUserModelId` fixes duplicate icons/shortcuts on the taskbar, it currently // While setting the `ProcessAppUserModelId` fixes duplicate icons/shortcuts on the taskbar, it currently
// causes the right-click context menu to function incorrectly. // causes the right-click context menu to function incorrectly.

View File

@ -31,7 +31,7 @@ namespace osu.Game.Benchmarks
realm = new RealmAccess(storage, OsuGameBase.CLIENT_DATABASE_FILENAME); realm = new RealmAccess(storage, OsuGameBase.CLIENT_DATABASE_FILENAME);
realm.Run(r => realm.Run(_ =>
{ {
realm.Write(c => c.Add(TestResources.CreateTestBeatmapSetInfo(rulesets: new[] { new OsuRuleset().RulesetInfo }))); realm.Write(c => c.Add(TestResources.CreateTestBeatmapSetInfo(rulesets: new[] { new OsuRuleset().RulesetInfo })));
}); });

View File

@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Catch.Tests
new JuiceStreamPathVertex(20, -5) new JuiceStreamPathVertex(20, -5)
})); }));
removeCount = path.RemoveVertices((_, i) => true); removeCount = path.RemoveVertices((_, _) => true);
Assert.That(removeCount, Is.EqualTo(1)); Assert.That(removeCount, Is.EqualTo(1));
Assert.That(path.Vertices, Is.EqualTo(new[] Assert.That(path.Vertices, Is.EqualTo(new[]
{ {

View File

@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.Tests
hyperDashCount = 0; hyperDashCount = 0;
// this needs to be done within the frame stable context due to how quickly hyperdash state changes occur. // this needs to be done within the frame stable context due to how quickly hyperdash state changes occur.
Player.DrawableRuleset.FrameStableComponents.OnUpdate += d => Player.DrawableRuleset.FrameStableComponents.OnUpdate += _ =>
{ {
var catcher = Player.ChildrenOfType<Catcher>().FirstOrDefault(); var catcher = Player.ChildrenOfType<Catcher>().FirstOrDefault();

View File

@ -135,15 +135,15 @@ namespace osu.Game.Rulesets.Catch.Edit
{ {
switch (BlueprintContainer.CurrentTool) switch (BlueprintContainer.CurrentTool)
{ {
case SelectTool _: case SelectTool:
if (EditorBeatmap.SelectedHitObjects.Count == 0) if (EditorBeatmap.SelectedHitObjects.Count == 0)
return null; return null;
double minTime = EditorBeatmap.SelectedHitObjects.Min(hitObject => hitObject.StartTime); double minTime = EditorBeatmap.SelectedHitObjects.Min(hitObject => hitObject.StartTime);
return getLastSnappableHitObject(minTime); return getLastSnappableHitObject(minTime);
case FruitCompositionTool _: case FruitCompositionTool:
case JuiceStreamCompositionTool _: case JuiceStreamCompositionTool:
if (!CursorInPlacementArea) if (!CursorInPlacementArea)
return null; return null;

View File

@ -42,10 +42,10 @@ namespace osu.Game.Rulesets.Catch.Edit
case Droplet droplet: case Droplet droplet:
return droplet is TinyDroplet ? PositionRange.EMPTY : new PositionRange(droplet.OriginalX); return droplet is TinyDroplet ? PositionRange.EMPTY : new PositionRange(droplet.OriginalX);
case JuiceStream _: case JuiceStream:
return GetPositionRange(hitObject.NestedHitObjects); return GetPositionRange(hitObject.NestedHitObjects);
case BananaShower _: case BananaShower:
// A banana shower occupies the whole screen width. // A banana shower occupies the whole screen width.
return new PositionRange(0, CatchPlayfield.WIDTH); return new PositionRange(0, CatchPlayfield.WIDTH);

View File

@ -131,7 +131,7 @@ namespace osu.Game.Rulesets.Catch.Edit
{ {
switch (hitObject) switch (hitObject)
{ {
case BananaShower _: case BananaShower:
return false; return false;
case JuiceStream juiceStream: case JuiceStream juiceStream:

View File

@ -389,13 +389,13 @@ namespace osu.Game.Rulesets.Catch.UI
{ {
switch (source) switch (source)
{ {
case Fruit _: case Fruit:
return caughtFruitPool.Get(); return caughtFruitPool.Get();
case Banana _: case Banana:
return caughtBananaPool.Get(); return caughtBananaPool.Get();
case Droplet _: case Droplet:
return caughtDropletPool.Get(); return caughtDropletPool.Get();
default: default:

View File

@ -173,7 +173,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
switch (original) switch (original)
{ {
case IHasDistance _: case IHasDistance:
{ {
var generator = new DistanceObjectPatternGenerator(Random, original, beatmap, lastPattern, originalBeatmap); var generator = new DistanceObjectPatternGenerator(Random, original, beatmap, lastPattern, originalBeatmap);
conversion = generator; conversion = generator;

View File

@ -156,9 +156,9 @@ namespace osu.Game.Rulesets.Mania.Difficulty
{ {
switch (m) switch (m)
{ {
case ManiaModNoFail _: case ManiaModNoFail:
case ManiaModEasy _: case ManiaModEasy:
case ManiaModHalfTime _: case ManiaModHalfTime:
scoreMultiplier *= 0.5; scoreMultiplier *= 0.5;
break; break;
} }

View File

@ -146,56 +146,56 @@ namespace osu.Game.Rulesets.Mania
{ {
switch (mod) switch (mod)
{ {
case ManiaModKey1 _: case ManiaModKey1:
value |= LegacyMods.Key1; value |= LegacyMods.Key1;
break; break;
case ManiaModKey2 _: case ManiaModKey2:
value |= LegacyMods.Key2; value |= LegacyMods.Key2;
break; break;
case ManiaModKey3 _: case ManiaModKey3:
value |= LegacyMods.Key3; value |= LegacyMods.Key3;
break; break;
case ManiaModKey4 _: case ManiaModKey4:
value |= LegacyMods.Key4; value |= LegacyMods.Key4;
break; break;
case ManiaModKey5 _: case ManiaModKey5:
value |= LegacyMods.Key5; value |= LegacyMods.Key5;
break; break;
case ManiaModKey6 _: case ManiaModKey6:
value |= LegacyMods.Key6; value |= LegacyMods.Key6;
break; break;
case ManiaModKey7 _: case ManiaModKey7:
value |= LegacyMods.Key7; value |= LegacyMods.Key7;
break; break;
case ManiaModKey8 _: case ManiaModKey8:
value |= LegacyMods.Key8; value |= LegacyMods.Key8;
break; break;
case ManiaModKey9 _: case ManiaModKey9:
value |= LegacyMods.Key9; value |= LegacyMods.Key9;
break; break;
case ManiaModDualStages _: case ManiaModDualStages:
value |= LegacyMods.KeyCoop; value |= LegacyMods.KeyCoop;
break; break;
case ManiaModFadeIn _: case ManiaModFadeIn:
value |= LegacyMods.FadeIn; value |= LegacyMods.FadeIn;
value &= ~LegacyMods.Hidden; // this is toggled on in the base call due to inheritance, but we don't want that. value &= ~LegacyMods.Hidden; // this is toggled on in the base call due to inheritance, but we don't want that.
break; break;
case ManiaModMirror _: case ManiaModMirror:
value |= LegacyMods.Mirror; value |= LegacyMods.Mirror;
break; break;
case ManiaModRandom _: case ManiaModRandom:
value |= LegacyMods.Random; value |= LegacyMods.Random;
break; break;
} }

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.Mods
var rng = new Random((int)Seed.Value); var rng = new Random((int)Seed.Value);
int availableColumns = ((ManiaBeatmap)beatmap).TotalColumns; int availableColumns = ((ManiaBeatmap)beatmap).TotalColumns;
var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => rng.Next()).ToList(); var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(_ => rng.Next()).ToList();
beatmap.HitObjects.OfType<ManiaHitObject>().ForEach(h => h.Column = shuffledColumns[h.Column]); beatmap.HitObjects.OfType<ManiaHitObject>().ForEach(h => h.Column = shuffledColumns[h.Column]);
} }

View File

@ -57,11 +57,11 @@ namespace osu.Game.Rulesets.Mania.Replays
{ {
switch (point) switch (point)
{ {
case HitPoint _: case HitPoint:
actions.Add(columnActions[point.Column]); actions.Add(columnActions[point.Column]);
break; break;
case ReleasePoint _: case ReleasePoint:
actions.Remove(columnActions[point.Column]); actions.Remove(columnActions[point.Column]);
break; break;
} }

View File

@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Osu.Tests
skin.Setup(s => s.GetTexture(It.IsAny<string>())).CallBase(); skin.Setup(s => s.GetTexture(It.IsAny<string>())).CallBase();
skin.Setup(s => s.GetTexture(It.IsIn(textureFilenames), It.IsAny<WrapMode>(), It.IsAny<WrapMode>())) skin.Setup(s => s.GetTexture(It.IsIn(textureFilenames), It.IsAny<WrapMode>(), It.IsAny<WrapMode>()))
.Returns((string componentName, WrapMode _, WrapMode __) => new Texture(1, 1) { AssetName = componentName }); .Returns((string componentName, WrapMode _, WrapMode _) => new Texture(1, 1) { AssetName = componentName });
Child = new DependencyProvidingContainer Child = new DependencyProvidingContainer
{ {

View File

@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
lastResult = null; lastResult = null;
spinner = nextSpinner; spinner = nextSpinner;
spinner.OnNewResult += (o, result) => lastResult = result; spinner.OnNewResult += (_, result) => lastResult = result;
} }
return lastResult?.Type == HitResult.Great; return lastResult?.Type == HitResult.Great;
@ -116,7 +116,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
return false; return false;
spinner = nextSpinner; spinner = nextSpinner;
spinner.OnNewResult += (o, result) => results.Add(result); spinner.OnNewResult += (_, result) => results.Add(result);
results.Clear(); results.Clear();
} }

View File

@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Osu.Edit
}); });
selectedHitObjects = EditorBeatmap.SelectedHitObjects.GetBoundCopy(); selectedHitObjects = EditorBeatmap.SelectedHitObjects.GetBoundCopy();
selectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid(); selectedHitObjects.CollectionChanged += (_, _) => updateDistanceSnapGrid();
placementObject = EditorBeatmap.PlacementObject.GetBoundCopy(); placementObject = EditorBeatmap.PlacementObject.GetBoundCopy();
placementObject.ValueChanged += _ => updateDistanceSnapGrid(); placementObject.ValueChanged += _ => updateDistanceSnapGrid();
@ -204,7 +204,7 @@ namespace osu.Game.Rulesets.Osu.Edit
switch (BlueprintContainer.CurrentTool) switch (BlueprintContainer.CurrentTool)
{ {
case SelectTool _: case SelectTool:
if (!EditorBeatmap.SelectedHitObjects.Any()) if (!EditorBeatmap.SelectedHitObjects.Any())
return; return;

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public void ApplyToDrawableHitObject(DrawableHitObject drawable) public void ApplyToDrawableHitObject(DrawableHitObject drawable)
{ {
drawable.ApplyCustomUpdateState += (drawableObject, state) => drawable.ApplyCustomUpdateState += (drawableObject, _) =>
{ {
if (!(drawableObject is DrawableHitCircle drawableHitCircle)) return; if (!(drawableObject is DrawableHitCircle drawableHitCircle)) return;

View File

@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Osu.Mods
switch (drawableObject) switch (drawableObject)
{ {
case DrawableSliderTail _: case DrawableSliderTail:
using (drawableObject.BeginAbsoluteSequence(fadeStartTime)) using (drawableObject.BeginAbsoluteSequence(fadeStartTime))
drawableObject.FadeOut(fadeDuration); drawableObject.FadeOut(fadeDuration);
@ -165,14 +165,14 @@ namespace osu.Game.Rulesets.Osu.Mods
switch (hitObject) switch (hitObject)
{ {
case Slider _: case Slider:
return (fadeOutStartTime, longFadeDuration); return (fadeOutStartTime, longFadeDuration);
case SliderTick _: case SliderTick:
double tickFadeOutDuration = Math.Min(hitObject.TimePreempt - DrawableSliderTick.ANIM_DURATION, 1000); double tickFadeOutDuration = Math.Min(hitObject.TimePreempt - DrawableSliderTick.ANIM_DURATION, 1000);
return (hitObject.StartTime - tickFadeOutDuration, tickFadeOutDuration); return (hitObject.StartTime - tickFadeOutDuration, tickFadeOutDuration);
case Spinner _: case Spinner:
return (fadeOutStartTime + longFadeDuration, fadeOutDuration); return (fadeOutStartTime + longFadeDuration, fadeOutDuration);
default: default:

View File

@ -44,13 +44,13 @@ namespace osu.Game.Rulesets.Osu.Mods
// apply grow effect // apply grow effect
switch (drawable) switch (drawable)
{ {
case DrawableSliderHead _: case DrawableSliderHead:
case DrawableSliderTail _: case DrawableSliderTail:
// special cases we should *not* be scaling. // special cases we should *not* be scaling.
break; break;
case DrawableSlider _: case DrawableSlider:
case DrawableHitCircle _: case DrawableHitCircle:
{ {
using (drawable.BeginAbsoluteSequence(h.StartTime - h.TimePreempt)) using (drawable.BeginAbsoluteSequence(h.StartTime - h.TimePreempt))
drawable.ScaleTo(StartScale.Value).Then().ScaleTo(EndScale, h.TimePreempt, Easing.OutSine); drawable.ScaleTo(StartScale.Value).Then().ScaleTo(EndScale, h.TimePreempt, Easing.OutSine);

View File

@ -34,10 +34,10 @@ namespace osu.Game.Rulesets.Osu.Mods
{ {
switch (drawable) switch (drawable)
{ {
case DrawableSliderHead _: case DrawableSliderHead:
case DrawableSliderTail _: case DrawableSliderTail:
case DrawableSliderTick _: case DrawableSliderTick:
case DrawableSliderRepeat _: case DrawableSliderRepeat:
return; return;
default: default:

View File

@ -156,7 +156,7 @@ namespace osu.Game.Rulesets.Osu.Objects
public Slider() public Slider()
{ {
SamplesBindable.CollectionChanged += (_, __) => UpdateNestedSamples(); SamplesBindable.CollectionChanged += (_, _) => UpdateNestedSamples();
Path.Version.ValueChanged += _ => updateNestedPositions(); Path.Version.ValueChanged += _ => updateNestedPositions();
} }

View File

@ -120,19 +120,19 @@ namespace osu.Game.Rulesets.Osu
{ {
switch (mod) switch (mod)
{ {
case OsuModAutopilot _: case OsuModAutopilot:
value |= LegacyMods.Autopilot; value |= LegacyMods.Autopilot;
break; break;
case OsuModSpunOut _: case OsuModSpunOut:
value |= LegacyMods.SpunOut; value |= LegacyMods.SpunOut;
break; break;
case OsuModTarget _: case OsuModTarget:
value |= LegacyMods.Target; value |= LegacyMods.Target;
break; break;
case OsuModTouchDevice _: case OsuModTouchDevice:
value |= LegacyMods.TouchDevice; value |= LegacyMods.TouchDevice;
break; break;
} }

View File

@ -107,7 +107,7 @@ namespace osu.Game.Rulesets.Osu.Replays
hitWindows = slider.TailCircle.HitWindows; hitWindows = slider.TailCircle.HitWindows;
break; break;
case Spinner _: case Spinner:
hitWindows = defaultHitWindows; hitWindows = defaultHitWindows;
break; break;
} }

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Osu.Scoring
{ {
switch (hitObject) switch (hitObject)
{ {
case HitCircle _: case HitCircle:
return new OsuHitCircleJudgementResult(hitObject, judgement); return new OsuHitCircleJudgementResult(hitObject, judgement);
default: default:

View File

@ -126,7 +126,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
break; break;
case DrawableSpinnerBonusTick _: case DrawableSpinnerBonusTick:
if (state == ArmedState.Hit) if (state == ArmedState.Hit)
glow.FlashColour(Color4.White, 200); glow.FlashColour(Color4.White, 200);

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.UI
switch (obj) switch (obj)
{ {
case DrawableSpinner _: case DrawableSpinner:
continue; continue;
case DrawableSlider slider: case DrawableSlider slider:

View File

@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.Osu.UI
// note: `Slider`'s `ProxiedLayer` is added when its nested `DrawableHitCircle` is loaded. // note: `Slider`'s `ProxiedLayer` is added when its nested `DrawableHitCircle` is loaded.
switch (drawable) switch (drawable)
{ {
case DrawableSpinner _: case DrawableSpinner:
spinnerProxies.Add(drawable.CreateProxy()); spinnerProxies.Add(drawable.CreateProxy());
break; break;

View File

@ -88,11 +88,11 @@ namespace osu.Game.Rulesets.Osu.Utils
switch (hitObject) switch (hitObject)
{ {
case HitCircle _: case HitCircle:
shift = clampHitCircleToPlayfield(current); shift = clampHitCircleToPlayfield(current);
break; break;
case Slider _: case Slider:
shift = clampSliderToPlayfield(current); shift = clampSliderToPlayfield(current);
break; break;
} }

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
AddStep("Setup judgements", () => AddStep("Setup judgements", () =>
{ {
judged = false; judged = false;
Player.ScoreProcessor.NewJudgement += b => judged = true; Player.ScoreProcessor.NewJudgement += _ => judged = true;
}); });
AddUntilStep("swell judged", () => judged); AddUntilStep("swell judged", () => judged);
AddAssert("failed", () => Player.GameplayState.HasFailed); AddAssert("failed", () => Player.GameplayState.HasFailed);

View File

@ -48,8 +48,8 @@ namespace osu.Game.Rulesets.Taiko.Mods
{ {
switch (hitObject) switch (hitObject)
{ {
case DrawableDrumRollTick _: case DrawableDrumRollTick:
case DrawableHit _: case DrawableHit:
double preempt = drawableRuleset.TimeRange.Value / drawableRuleset.ControlPointAt(hitObject.HitObject.StartTime).Multiplier; double preempt = drawableRuleset.TimeRange.Value / drawableRuleset.ControlPointAt(hitObject.HitObject.StartTime).Multiplier;
double start = hitObject.HitObject.StartTime - preempt * fade_out_start_time; double start = hitObject.HitObject.StartTime - preempt * fade_out_start_time;
double duration = preempt * fade_out_duration; double duration = preempt * fade_out_duration;

View File

@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
DisplayColour.Value = Type == HitType.Centre ? COLOUR_CENTRE : COLOUR_RIM; DisplayColour.Value = Type == HitType.Centre ? COLOUR_CENTRE : COLOUR_RIM;
}); });
SamplesBindable.BindCollectionChanged((_, __) => updateTypeFromSamples()); SamplesBindable.BindCollectionChanged((_, _) => updateTypeFromSamples());
} }
private void updateTypeFromSamples() private void updateTypeFromSamples()

View File

@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
protected TaikoStrongableHitObject() protected TaikoStrongableHitObject()
{ {
IsStrongBindable.BindValueChanged(_ => updateSamplesFromType()); IsStrongBindable.BindValueChanged(_ => updateSamplesFromType());
SamplesBindable.BindCollectionChanged((_, __) => updateTypeFromSamples()); SamplesBindable.BindCollectionChanged((_, _) => updateTypeFromSamples());
} }
private void updateTypeFromSamples() private void updateTypeFromSamples()

View File

@ -245,7 +245,7 @@ namespace osu.Game.Rulesets.Taiko.UI
barLinePlayfield.Add(barLine); barLinePlayfield.Add(barLine);
break; break;
case DrawableTaikoHitObject _: case DrawableTaikoHitObject:
base.Add(h); base.Add(h);
break; break;
@ -261,7 +261,7 @@ namespace osu.Game.Rulesets.Taiko.UI
case DrawableBarLine barLine: case DrawableBarLine barLine:
return barLinePlayfield.Remove(barLine); return barLinePlayfield.Remove(barLine);
case DrawableTaikoHitObject _: case DrawableTaikoHitObject:
return base.Remove(h); return base.Remove(h);
default: default:
@ -280,12 +280,12 @@ namespace osu.Game.Rulesets.Taiko.UI
switch (result.Judgement) switch (result.Judgement)
{ {
case TaikoStrongJudgement _: case TaikoStrongJudgement:
if (result.IsHit) if (result.IsHit)
hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == ((DrawableStrongNestedHit)judgedObject).ParentHitObject)?.VisualiseSecondHit(result); hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == ((DrawableStrongNestedHit)judgedObject).ParentHitObject)?.VisualiseSecondHit(result);
break; break;
case TaikoDrumRollTickJudgement _: case TaikoDrumRollTickJudgement:
if (!result.IsHit) if (!result.IsHit)
break; break;

View File

@ -99,7 +99,7 @@ namespace osu.Game.Tests.Collections.IO
public async Task TestImportMalformedDatabase() public async Task TestImportMalformedDatabase()
{ {
bool exceptionThrown = false; bool exceptionThrown = false;
UnhandledExceptionEventHandler setException = (_, __) => exceptionThrown = true; UnhandledExceptionEventHandler setException = (_, _) => exceptionThrown = true;
using (HeadlessGameHost host = new CleanRunHeadlessGameHost()) using (HeadlessGameHost host = new CleanRunHeadlessGameHost())
{ {

View File

@ -46,7 +46,7 @@ namespace osu.Game.Tests.Database
realm.RegisterCustomSubscription(r => realm.RegisterCustomSubscription(r =>
{ {
var subscription = r.All<BeatmapInfo>().QueryAsyncWithNotifications((sender, changes, error) => var subscription = r.All<BeatmapInfo>().QueryAsyncWithNotifications((_, _, _) =>
{ {
realm.Run(_ => realm.Run(_ =>
{ {

View File

@ -189,7 +189,7 @@ namespace osu.Game.Tests.Database
}); });
// Can't be used, even from within a valid context. // Can't be used, even from within a valid context.
realm.Run(threadContext => realm.Run(_ =>
{ {
Assert.Throws<InvalidOperationException>(() => Assert.Throws<InvalidOperationException>(() =>
{ {

View File

@ -157,7 +157,7 @@ namespace osu.Game.Tests.NonVisual.Skinning
{ {
// use an incrementing width to allow assertion matching on correct textures as they turn from uploads into actual textures. // use an incrementing width to allow assertion matching on correct textures as they turn from uploads into actual textures.
int width = 1; int width = 1;
Textures = fileNames.ToDictionary(fileName => fileName, fileName => new TextureUpload(new Image<Rgba32>(width, width++))); Textures = fileNames.ToDictionary(fileName => fileName, _ => new TextureUpload(new Image<Rgba32>(width, width++)));
} }
public TextureUpload Get(string name) => Textures.GetValueOrDefault(name); public TextureUpload Get(string name) => Textures.GetValueOrDefault(name);

View File

@ -322,8 +322,8 @@ namespace osu.Game.Tests.Visual.Gameplay
{ {
switch (h) switch (h)
{ {
case TestPooledHitObject _: case TestPooledHitObject:
case TestPooledParentHitObject _: case TestPooledParentHitObject:
return null; return null;
case TestParentHitObject p: case TestParentHitObject p:

View File

@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Gameplay
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
HealthProcessor.FailConditions += (_, __) => true; HealthProcessor.FailConditions += (_, _) => true;
} }
private double lastFrequency = double.MaxValue; private double lastFrequency = double.MaxValue;

View File

@ -49,7 +49,7 @@ namespace osu.Game.Tests.Visual.Gameplay
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
HealthProcessor.FailConditions += (_, __) => true; HealthProcessor.FailConditions += (_, _) => true;
} }
} }
} }

View File

@ -45,7 +45,7 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test] [Test]
public void TestToggleEditor() public void TestToggleEditor()
{ {
AddToggleStep("toggle editor visibility", visible => skinEditor.ToggleVisibility()); AddToggleStep("toggle editor visibility", _ => skinEditor.ToggleVisibility());
} }
[Test] [Test]

View File

@ -103,7 +103,7 @@ namespace osu.Game.Tests.Visual.Gameplay
Child = new SkinProvidingContainer(secondarySource) Child = new SkinProvidingContainer(secondarySource)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Child = consumer = new SkinConsumer("test", name => new NamedBox("Default Implementation")) Child = consumer = new SkinConsumer("test", _ => new NamedBox("Default Implementation"))
} }
}; };
}); });
@ -132,7 +132,7 @@ namespace osu.Game.Tests.Visual.Gameplay
}; };
}); });
AddStep("add permissive", () => target.Add(consumer = new SkinConsumer("test", name => new NamedBox("Default Implementation")))); AddStep("add permissive", () => target.Add(consumer = new SkinConsumer("test", _ => new NamedBox("Default Implementation"))));
AddAssert("consumer using override source", () => consumer.Drawable is SecondarySourceBox); AddAssert("consumer using override source", () => consumer.Drawable is SecondarySourceBox);
AddAssert("skinchanged only called once", () => consumer.SkinChangedCount == 1); AddAssert("skinchanged only called once", () => consumer.SkinChangedCount == 1);
} }
@ -155,7 +155,7 @@ namespace osu.Game.Tests.Visual.Gameplay
}; };
}); });
AddStep("add permissive", () => target.Add(consumer = new SkinConsumer("test", name => new NamedBox("Default Implementation")))); AddStep("add permissive", () => target.Add(consumer = new SkinConsumer("test", _ => new NamedBox("Default Implementation"))));
AddAssert("consumer using override source", () => consumer.Drawable is SecondarySourceBox); AddAssert("consumer using override source", () => consumer.Drawable is SecondarySourceBox);
AddStep("disable", () => target.Disable()); AddStep("disable", () => target.Disable());
AddAssert("consumer using base source", () => consumer.Drawable is BaseSourceBox); AddAssert("consumer using base source", () => consumer.Drawable is BaseSourceBox);

View File

@ -44,7 +44,7 @@ namespace osu.Game.Tests.Visual.Gameplay
base.SetUpSteps(); base.SetUpSteps();
AddStep("enable storyboard", () => LocalConfig.SetValue(OsuSetting.ShowStoryboard, true)); AddStep("enable storyboard", () => LocalConfig.SetValue(OsuSetting.ShowStoryboard, true));
AddStep("set dim level to 0", () => LocalConfig.SetValue<double>(OsuSetting.DimLevel, 0)); AddStep("set dim level to 0", () => LocalConfig.SetValue<double>(OsuSetting.DimLevel, 0));
AddStep("reset fail conditions", () => currentFailConditions = (_, __) => false); AddStep("reset fail conditions", () => currentFailConditions = (_, _) => false);
AddStep("set storyboard duration to 2s", () => currentStoryboardDuration = 2000); AddStep("set storyboard duration to 2s", () => currentStoryboardDuration = 2000);
AddStep("set ShowResults = true", () => showResults = true); AddStep("set ShowResults = true", () => showResults = true);
} }
@ -91,7 +91,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{ {
CreateTest(() => CreateTest(() =>
{ {
AddStep("fail on first judgement", () => currentFailConditions = (_, __) => true); AddStep("fail on first judgement", () => currentFailConditions = (_, _) => true);
// Fail occurs at 164ms with the provided beatmap. // Fail occurs at 164ms with the provided beatmap.
// Fail animation runs for 2.5s realtime but the gameplay time change is *variable* due to the frequency transform being applied, so we need a bit of lenience. // Fail animation runs for 2.5s realtime but the gameplay time change is *variable* due to the frequency transform being applied, so we need a bit of lenience.

View File

@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
// To emulate `MultiplayerClient.CurrentMatchPlayingUserIds` we need a bindable list of *only IDs*. // To emulate `MultiplayerClient.CurrentMatchPlayingUserIds` we need a bindable list of *only IDs*.
// This tracks the list of users 1:1. // This tracks the list of users 1:1.
MultiplayerUsers.BindCollectionChanged((c, e) => MultiplayerUsers.BindCollectionChanged((_, e) =>
{ {
switch (e.Action) switch (e.Action)
{ {

View File

@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
var mockLounge = new Mock<LoungeSubScreen>(); var mockLounge = new Mock<LoungeSubScreen>();
mockLounge mockLounge
.Setup(l => l.Join(It.IsAny<Room>(), It.IsAny<string>(), It.IsAny<Action<Room>>(), It.IsAny<Action<string>>())) .Setup(l => l.Join(It.IsAny<Room>(), It.IsAny<string>(), It.IsAny<Action<Room>>(), It.IsAny<Action<string>>()))
.Callback<Room, string, Action<Room>, Action<string>>((a, b, c, d) => .Callback<Room, string, Action<Room>, Action<string>>((_, _, _, d) =>
{ {
Task.Run(() => Task.Run(() =>
{ {

View File

@ -90,7 +90,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
setRoomCountdown(countdownStart.Duration); setRoomCountdown(countdownStart.Duration);
break; break;
case StopCountdownRequest _: case StopCountdownRequest:
multiplayerRoom.Countdown = null; multiplayerRoom.Countdown = null;
raiseRoomUpdated(); raiseRoomUpdated();
break; break;

View File

@ -219,7 +219,7 @@ namespace osu.Game.Tests.Visual.Online
{ {
base.LoadComplete(); base.LoadComplete();
Metadata.BindValueChanged(metadata => Metadata.BindValueChanged(_ =>
{ {
foreach (var b in this.ChildrenOfType<YearButton>()) foreach (var b in this.ChildrenOfType<YearButton>())
b.Action = () => YearChanged?.Invoke(b.Year); b.Action = () => YearChanged?.Invoke(b.Year);

View File

@ -187,8 +187,8 @@ namespace osu.Game.Tests.Visual.Playlists
// pre-check for requests we should be handling (as they are scheduled below). // pre-check for requests we should be handling (as they are scheduled below).
switch (request) switch (request)
{ {
case ShowPlaylistUserScoreRequest _: case ShowPlaylistUserScoreRequest:
case IndexPlaylistScoresRequest _: case IndexPlaylistScoresRequest:
break; break;
default: default:

View File

@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual.Settings
public void ToggleVisibility() public void ToggleVisibility()
{ {
AddWaitStep("wait some", 5); AddWaitStep("wait some", 5);
AddToggleStep("toggle visibility", visible => settings.ToggleVisibility()); AddToggleStep("toggle visibility", _ => settings.ToggleVisibility());
} }
[Test] [Test]

View File

@ -91,19 +91,19 @@ namespace osu.Game.Tests.Visual.SongSelect
switch (instance) switch (instance)
{ {
case OsuRuleset _: case OsuRuleset:
testInfoLabels(5); testInfoLabels(5);
break; break;
case TaikoRuleset _: case TaikoRuleset:
testInfoLabels(5); testInfoLabels(5);
break; break;
case CatchRuleset _: case CatchRuleset:
testInfoLabels(5); testInfoLabels(5);
break; break;
case ManiaRuleset _: case ManiaRuleset:
testInfoLabels(4); testInfoLabels(4);
break; break;

View File

@ -70,7 +70,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("Set time before zero", () => AddStep("Set time before zero", () =>
{ {
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) => beatContainer.NewBeat = (i, timingControlPoint, _, _) =>
{ {
lastActuationTime = gameplayClockContainer.CurrentTime; lastActuationTime = gameplayClockContainer.CurrentTime;
lastTimingPoint = timingControlPoint; lastTimingPoint = timingControlPoint;
@ -105,7 +105,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("Set time before zero", () => AddStep("Set time before zero", () =>
{ {
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) => beatContainer.NewBeat = (i, timingControlPoint, _, _) =>
{ {
lastBeatIndex = i; lastBeatIndex = i;
lastBpm = timingControlPoint.BPM; lastBpm = timingControlPoint.BPM;
@ -126,7 +126,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("bind event", () => AddStep("bind event", () =>
{ {
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) => lastBpm = timingControlPoint.BPM; beatContainer.NewBeat = (_, timingControlPoint, _, _) => lastBpm = timingControlPoint.BPM;
}); });
AddUntilStep("wait for trigger", () => lastBpm != null); AddUntilStep("wait for trigger", () => lastBpm != null);
@ -157,7 +157,7 @@ namespace osu.Game.Tests.Visual.UserInterface
actualEffectPoint = null; actualEffectPoint = null;
beatContainer.AllowMistimedEventFiring = false; beatContainer.AllowMistimedEventFiring = false;
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) => beatContainer.NewBeat = (_, _, effectControlPoint, _) =>
{ {
if (Precision.AlmostEquals(gameplayClockContainer.CurrentTime + earlyActivationMilliseconds, expectedEffectPoint.Time, BeatSyncedContainer.MISTIMED_ALLOWANCE)) if (Precision.AlmostEquals(gameplayClockContainer.CurrentTime + earlyActivationMilliseconds, expectedEffectPoint.Time, BeatSyncedContainer.MISTIMED_ALLOWANCE))
actualEffectPoint = effectControlPoint; actualEffectPoint = effectControlPoint;

View File

@ -77,13 +77,13 @@ namespace osu.Game.Tests.Visual.UserInterface
}; };
control.Query.BindValueChanged(q => query.Text = $"Query: {q.NewValue}", true); control.Query.BindValueChanged(q => query.Text = $"Query: {q.NewValue}", true);
control.General.BindCollectionChanged((u, v) => general.Text = $"General: {(control.General.Any() ? string.Join('.', control.General.Select(i => i.ToString().Underscore())) : "")}", true); control.General.BindCollectionChanged((_, _) => general.Text = $"General: {(control.General.Any() ? string.Join('.', control.General.Select(i => i.ToString().Underscore())) : "")}", true);
control.Ruleset.BindValueChanged(r => ruleset.Text = $"Ruleset: {r.NewValue}", true); control.Ruleset.BindValueChanged(r => ruleset.Text = $"Ruleset: {r.NewValue}", true);
control.Category.BindValueChanged(c => category.Text = $"Category: {c.NewValue}", true); control.Category.BindValueChanged(c => category.Text = $"Category: {c.NewValue}", true);
control.Genre.BindValueChanged(g => genre.Text = $"Genre: {g.NewValue}", true); control.Genre.BindValueChanged(g => genre.Text = $"Genre: {g.NewValue}", true);
control.Language.BindValueChanged(l => language.Text = $"Language: {l.NewValue}", true); control.Language.BindValueChanged(l => language.Text = $"Language: {l.NewValue}", true);
control.Extra.BindCollectionChanged((u, v) => extra.Text = $"Extra: {(control.Extra.Any() ? string.Join('.', control.Extra.Select(i => i.ToString().ToLowerInvariant())) : "")}", true); control.Extra.BindCollectionChanged((_, _) => extra.Text = $"Extra: {(control.Extra.Any() ? string.Join('.', control.Extra.Select(i => i.ToString().ToLowerInvariant())) : "")}", true);
control.Ranks.BindCollectionChanged((u, v) => ranks.Text = $"Ranks: {(control.Ranks.Any() ? string.Join('.', control.Ranks.Select(i => i.ToString())) : "")}", true); control.Ranks.BindCollectionChanged((_, _) => ranks.Text = $"Ranks: {(control.Ranks.Any() ? string.Join('.', control.Ranks.Select(i => i.ToString())) : "")}", true);
control.Played.BindValueChanged(p => played.Text = $"Played: {p.NewValue}", true); control.Played.BindValueChanged(p => played.Text = $"Played: {p.NewValue}", true);
control.ExplicitContent.BindValueChanged(e => explicitMap.Text = $"Explicit Maps: {e.NewValue}", true); control.ExplicitContent.BindValueChanged(e => explicitMap.Text = $"Explicit Maps: {e.NewValue}", true);
}); });

View File

@ -54,7 +54,7 @@ namespace osu.Game.Tests.Visual.UserInterface
notificationOverlay.Reset(); notificationOverlay.Reset();
performer.Setup(g => g.PerformFromScreen(It.IsAny<Action<IScreen>>(), It.IsAny<IEnumerable<Type>>())) performer.Setup(g => g.PerformFromScreen(It.IsAny<Action<IScreen>>(), It.IsAny<IEnumerable<Type>>()))
.Callback((Action<IScreen> action, IEnumerable<Type> types) => action(null)); .Callback((Action<IScreen> action, IEnumerable<Type> _) => action(null));
notificationOverlay.Setup(n => n.Post(It.IsAny<Notification>())) notificationOverlay.Setup(n => n.Post(It.IsAny<Notification>()))
.Callback((Notification n) => lastNotification = n); .Callback((Notification n) => lastNotification = n);

View File

@ -387,7 +387,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddUntilStep("double time not visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).All(panel => panel.Filtered.Value)); AddUntilStep("double time not visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).All(panel => panel.Filtered.Value));
AddAssert("nightcore still visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value)); AddAssert("nightcore still visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value));
AddStep("make double time valid again", () => modSelectOverlay.IsValidMod = m => true); AddStep("make double time valid again", () => modSelectOverlay.IsValidMod = _ => true);
AddUntilStep("double time visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).Any(panel => !panel.Filtered.Value)); AddUntilStep("double time visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).Any(panel => !panel.Filtered.Value));
AddAssert("nightcore still visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(b => b.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value)); AddAssert("nightcore still visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(b => b.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value));
} }

View File

@ -30,7 +30,7 @@ namespace osu.Game.Tournament.Components
{ {
base.Current = new Bindable<string>(string.Empty); base.Current = new Bindable<string>(string.Empty);
((OsuTextBox)Control).OnCommit += (sender, newText) => ((OsuTextBox)Control).OnCommit += (sender, _) =>
{ {
try try
{ {

View File

@ -45,7 +45,7 @@ namespace osu.Game.Tournament.Components
FillMode = FillMode.Fill FillMode = FillMode.Fill
}; };
(flag = team.FlagName.GetBoundCopy()).BindValueChanged(acronym => flagSprite.Texture = textures.Get($@"Flags/{team.FlagName}"), true); (flag = team.FlagName.GetBoundCopy()).BindValueChanged(_ => flagSprite.Texture = textures.Get($@"Flags/{team.FlagName}"), true);
} }
} }
} }

View File

@ -27,7 +27,7 @@ namespace osu.Game.Tournament.Components
{ {
if (team == null) return; if (team == null) return;
(acronym = team.Acronym.GetBoundCopy()).BindValueChanged(acronym => Text.Text = team?.FullName.Value ?? string.Empty, true); (acronym = team.Acronym.GetBoundCopy()).BindValueChanged(_ => Text.Text = team?.FullName.Value ?? string.Empty, true);
} }
} }
} }

View File

@ -38,7 +38,7 @@ namespace osu.Game.Tournament.Components
{ {
if (Team == null) return; if (Team == null) return;
(acronym = Team.Acronym.GetBoundCopy()).BindValueChanged(acronym => AcronymText.Text = Team?.Acronym.Value?.ToUpperInvariant() ?? string.Empty, true); (acronym = Team.Acronym.GetBoundCopy()).BindValueChanged(_ => AcronymText.Text = Team?.Acronym.Value?.ToUpperInvariant() ?? string.Empty, true);
} }
} }
} }

View File

@ -219,7 +219,7 @@ namespace osu.Game.Tournament.Screens.Drawings
} }
} }
writeOp = writeOp?.ContinueWith(t => { writeAction(); }) ?? Task.Run(writeAction); writeOp = writeOp?.ContinueWith(_ => { writeAction(); }) ?? Task.Run(writeAction);
} }
private void reloadTeams() private void reloadTeams()

View File

@ -44,7 +44,7 @@ namespace osu.Game.Tournament.Screens.Editors
AddInternal(rightClickMessage = new WarningBox("Right click to place and link matches")); AddInternal(rightClickMessage = new WarningBox("Right click to place and link matches"));
LadderInfo.Matches.CollectionChanged += (_, __) => updateMessage(); LadderInfo.Matches.CollectionChanged += (_, _) => updateMessage();
updateMessage(); updateMessage();
} }

View File

@ -49,10 +49,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
}; };
name = round.Name.GetBoundCopy(); name = round.Name.GetBoundCopy();
name.BindValueChanged(n => textName.Text = ((losers ? "Losers " : "") + round.Name).ToUpperInvariant(), true); name.BindValueChanged(_ => textName.Text = ((losers ? "Losers " : "") + round.Name).ToUpperInvariant(), true);
description = round.Description.GetBoundCopy(); description = round.Description.GetBoundCopy();
description.BindValueChanged(n => textDescription.Text = round.Description.Value?.ToUpperInvariant(), true); description.BindValueChanged(_ => textDescription.Text = round.Description.Value?.ToUpperInvariant(), true);
} }
} }
} }

View File

@ -75,7 +75,7 @@ namespace osu.Game.Tournament.Screens.Ladder
foreach (var match in LadderInfo.Matches) foreach (var match in LadderInfo.Matches)
addMatch(match); addMatch(match);
LadderInfo.Rounds.CollectionChanged += (_, __) => layout.Invalidate(); LadderInfo.Rounds.CollectionChanged += (_, _) => layout.Invalidate();
LadderInfo.Matches.CollectionChanged += (_, args) => LadderInfo.Matches.CollectionChanged += (_, args) =>
{ {
switch (args.Action) switch (args.Action)

View File

@ -137,7 +137,7 @@ namespace osu.Game.Tournament
heightWarning.Alpha = size.NewValue.Width < minWidth ? 1 : 0; heightWarning.Alpha = size.NewValue.Width < minWidth ? 1 : 0;
}), true); }), true);
windowMode.BindValueChanged(mode => ScheduleAfterChildren(() => windowMode.BindValueChanged(_ => ScheduleAfterChildren(() =>
{ {
windowMode.Value = WindowMode.Windowed; windowMode.Value = WindowMode.Windowed;
}), true); }), true);

View File

@ -267,7 +267,7 @@ namespace osu.Game.Tournament
} }
else else
{ {
req.Success += res => { populate(); }; req.Success += _ => { populate(); };
req.Failure += _ => req.Failure += _ =>
{ {
user.OnlineID = 1; user.OnlineID = 1;

View File

@ -204,12 +204,12 @@ namespace osu.Game.Tournament
switch (currentScreen) switch (currentScreen)
{ {
case MapPoolScreen _: case MapPoolScreen:
chatContainer.FadeIn(TournamentScreen.FADE_DELAY); chatContainer.FadeIn(TournamentScreen.FADE_DELAY);
chatContainer.ResizeWidthTo(1, 500, Easing.OutQuint); chatContainer.ResizeWidthTo(1, 500, Easing.OutQuint);
break; break;
case GameplayScreen _: case GameplayScreen:
chatContainer.FadeIn(TournamentScreen.FADE_DELAY); chatContainer.FadeIn(TournamentScreen.FADE_DELAY);
chatContainer.ResizeWidthTo(0.5f, 500, Easing.OutQuint); chatContainer.ResizeWidthTo(0.5f, 500, Easing.OutQuint);
break; break;

View File

@ -254,12 +254,12 @@ namespace osu.Game.Beatmaps.ControlPoints
switch (newPoint) switch (newPoint)
{ {
case TimingControlPoint _: case TimingControlPoint:
// Timing points are a special case and need to be added regardless of fallback availability. // Timing points are a special case and need to be added regardless of fallback availability.
existing = BinarySearch(TimingPoints, time); existing = BinarySearch(TimingPoints, time);
break; break;
case EffectControlPoint _: case EffectControlPoint:
existing = EffectPointAt(time); existing = EffectPointAt(time);
break; break;
} }

View File

@ -102,7 +102,7 @@ namespace osu.Game.Beatmaps.Drawables
// Matches osu-stable, in order to provide new users with roughly the same randomised selection of bundled beatmaps. // Matches osu-stable, in order to provide new users with roughly the same randomised selection of bundled beatmaps.
var random = new LegacyRandom(DateTime.UtcNow.Year * 1000 + (DateTime.UtcNow.DayOfYear / 7)); var random = new LegacyRandom(DateTime.UtcNow.Year * 1000 + (DateTime.UtcNow.DayOfYear / 7));
downloadableFilenames.AddRange(sourceFilenames.OrderBy(x => random.NextDouble()).Take(limit ?? int.MaxValue)); downloadableFilenames.AddRange(sourceFilenames.OrderBy(_ => random.NextDouble()).Take(limit ?? int.MaxValue));
} }
catch { } catch { }
} }

View File

@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps.Formats
{ {
public static void Register() public static void Register()
{ {
AddDecoder<Beatmap>("{", m => new JsonBeatmapDecoder()); AddDecoder<Beatmap>("{", _ => new JsonBeatmapDecoder());
} }
protected override void ParseStreamInto(LineBufferedReader stream, Beatmap output) protected override void ParseStreamInto(LineBufferedReader stream, Beatmap output)

View File

@ -373,11 +373,11 @@ namespace osu.Game.Beatmaps.Formats
switch (hitObject) switch (hitObject)
{ {
case IHasPath _: case IHasPath:
type |= LegacyHitObjectType.Slider; type |= LegacyHitObjectType.Slider;
break; break;
case IHasDuration _: case IHasDuration:
if (onlineRulesetID == 3) if (onlineRulesetID == 3)
type |= LegacyHitObjectType.Hold; type |= LegacyHitObjectType.Hold;
else else

View File

@ -35,7 +35,7 @@ namespace osu.Game.Beatmaps.Formats
{ {
// note that this isn't completely correct // note that this isn't completely correct
AddDecoder<Storyboard>(@"osu file format v", m => new LegacyStoryboardDecoder(Parsing.ParseInt(m.Split('v').Last()))); AddDecoder<Storyboard>(@"osu file format v", m => new LegacyStoryboardDecoder(Parsing.ParseInt(m.Split('v').Last())));
AddDecoder<Storyboard>(@"[Events]", m => new LegacyStoryboardDecoder()); AddDecoder<Storyboard>(@"[Events]", _ => new LegacyStoryboardDecoder());
SetFallbackDecoder<Storyboard>(() => new LegacyStoryboardDecoder()); SetFallbackDecoder<Storyboard>(() => new LegacyStoryboardDecoder());
} }

View File

@ -56,12 +56,12 @@ namespace osu.Game.Beatmaps.Legacy
{ {
switch (newPoint) switch (newPoint)
{ {
case SampleControlPoint _: case SampleControlPoint:
// intentionally don't use SamplePointAt (we always need to consider the first sample point). // intentionally don't use SamplePointAt (we always need to consider the first sample point).
var existing = BinarySearch(SamplePoints, time); var existing = BinarySearch(SamplePoints, time);
return newPoint.IsRedundant(existing); return newPoint.IsRedundant(existing);
case DifficultyControlPoint _: case DifficultyControlPoint:
return newPoint.IsRedundant(DifficultyPointAt(time)); return newPoint.IsRedundant(DifficultyPointAt(time));
default: default:

View File

@ -36,7 +36,7 @@ namespace osu.Game.Collections
public BeatmapCollection() public BeatmapCollection()
{ {
BeatmapHashes.CollectionChanged += (_, __) => onChange(); BeatmapHashes.CollectionChanged += (_, _) => onChange();
Name.ValueChanged += _ => onChange(); Name.ValueChanged += _ => onChange();
} }

View File

@ -67,7 +67,7 @@ namespace osu.Game.Collections
// An extra bindable is enough to subvert this behaviour. // An extra bindable is enough to subvert this behaviour.
base.Current = Current; base.Current = Current;
collections.BindCollectionChanged((_, __) => collectionsChanged(), true); collections.BindCollectionChanged((_, _) => collectionsChanged(), true);
Current.BindValueChanged(filterChanged, true); Current.BindValueChanged(filterChanged, true);
} }
@ -233,7 +233,7 @@ namespace osu.Game.Collections
if (collectionBeatmaps != null) if (collectionBeatmaps != null)
{ {
collectionBeatmaps.CollectionChanged += (_, __) => collectionChanged(); collectionBeatmaps.CollectionChanged += (_, _) => collectionChanged();
beatmap.BindValueChanged(_ => collectionChanged(), true); beatmap.BindValueChanged(_ => collectionChanged(), true);
} }

View File

@ -261,7 +261,7 @@ namespace osu.Game.Collections
private void backgroundSave() private void backgroundSave()
{ {
int current = Interlocked.Increment(ref lastSave); int current = Interlocked.Increment(ref lastSave);
Task.Delay(100).ContinueWith(task => Task.Delay(100).ContinueWith(_ =>
{ {
if (current != lastSave) if (current != lastSave)
return; return;

View File

@ -454,7 +454,7 @@ namespace osu.Game.Database
public IDisposable SubscribeToPropertyChanged<TModel, TProperty>(Func<Realm, TModel?> modelAccessor, Expression<Func<TModel, TProperty>> propertyLookup, Action<TProperty> onChanged) public IDisposable SubscribeToPropertyChanged<TModel, TProperty>(Func<Realm, TModel?> modelAccessor, Expression<Func<TModel, TProperty>> propertyLookup, Action<TProperty> onChanged)
where TModel : RealmObjectBase where TModel : RealmObjectBase
{ {
return RegisterCustomSubscription(r => return RegisterCustomSubscription(_ =>
{ {
string propertyName = getMemberName(propertyLookup); string propertyName = getMemberName(propertyLookup);

View File

@ -20,7 +20,7 @@ namespace osu.Game.Database
{ {
private static readonly IMapper write_mapper = new MapperConfiguration(c => private static readonly IMapper write_mapper = new MapperConfiguration(c =>
{ {
c.ShouldMapField = fi => false; c.ShouldMapField = _ => false;
c.ShouldMapProperty = pi => pi.SetMethod?.IsPublic == true; c.ShouldMapProperty = pi => pi.SetMethod?.IsPublic == true;
c.CreateMap<BeatmapMetadata, BeatmapMetadata>() c.CreateMap<BeatmapMetadata, BeatmapMetadata>()
@ -70,7 +70,7 @@ namespace osu.Game.Database
} }
}); });
c.Internal().ForAllMaps((typeMap, expression) => c.Internal().ForAllMaps((_, expression) =>
{ {
expression.ForAllMembers(m => expression.ForAllMembers(m =>
{ {
@ -87,7 +87,7 @@ namespace osu.Game.Database
c.CreateMap<BeatmapSetInfo, BeatmapSetInfo>() c.CreateMap<BeatmapSetInfo, BeatmapSetInfo>()
.ConstructUsing(_ => new BeatmapSetInfo(null)) .ConstructUsing(_ => new BeatmapSetInfo(null))
.MaxDepth(2) .MaxDepth(2)
.AfterMap((s, d) => .AfterMap((_, d) =>
{ {
foreach (var beatmap in d.Beatmaps) foreach (var beatmap in d.Beatmaps)
beatmap.BeatmapSet = d; beatmap.BeatmapSet = d;
@ -97,7 +97,7 @@ namespace osu.Game.Database
// Only hasn't been done yet as we detach at the point of BeatmapInfo less often. // Only hasn't been done yet as we detach at the point of BeatmapInfo less often.
c.CreateMap<BeatmapInfo, BeatmapInfo>() c.CreateMap<BeatmapInfo, BeatmapInfo>()
.MaxDepth(2) .MaxDepth(2)
.AfterMap((s, d) => .AfterMap((_, d) =>
{ {
for (int i = 0; i < d.BeatmapSet?.Beatmaps.Count; i++) for (int i = 0; i < d.BeatmapSet?.Beatmaps.Count; i++)
{ {
@ -121,7 +121,7 @@ namespace osu.Game.Database
.ConstructUsing(_ => new BeatmapSetInfo(null)) .ConstructUsing(_ => new BeatmapSetInfo(null))
.MaxDepth(2) .MaxDepth(2)
.ForMember(b => b.Files, cc => cc.Ignore()) .ForMember(b => b.Files, cc => cc.Ignore())
.AfterMap((s, d) => .AfterMap((_, d) =>
{ {
foreach (var beatmap in d.Beatmaps) foreach (var beatmap in d.Beatmaps)
beatmap.BeatmapSet = d; beatmap.BeatmapSet = d;
@ -135,14 +135,14 @@ namespace osu.Game.Database
private static void applyCommonConfiguration(IMapperConfigurationExpression c) private static void applyCommonConfiguration(IMapperConfigurationExpression c)
{ {
c.ShouldMapField = fi => false; c.ShouldMapField = _ => false;
// This is specifically to avoid mapping explicit interface implementations. // This is specifically to avoid mapping explicit interface implementations.
// If we want to limit this further, we can avoid mapping properties with no setter that are not IList<>. // If we want to limit this further, we can avoid mapping properties with no setter that are not IList<>.
// Takes a bit of effort to determine whether this is the case though, see https://stackoverflow.com/questions/951536/how-do-i-tell-whether-a-type-implements-ilist // Takes a bit of effort to determine whether this is the case though, see https://stackoverflow.com/questions/951536/how-do-i-tell-whether-a-type-implements-ilist
c.ShouldMapProperty = pi => pi.GetMethod?.IsPublic == true; c.ShouldMapProperty = pi => pi.GetMethod?.IsPublic == true;
c.Internal().ForAllMaps((typeMap, expression) => c.Internal().ForAllMaps((_, expression) =>
{ {
expression.ForAllMembers(m => expression.ForAllMembers(m =>
{ {

View File

@ -31,7 +31,7 @@ namespace osu.Game.Extensions
{ {
var tcs = new TaskCompletionSource<bool>(); var tcs = new TaskCompletionSource<bool>();
task.ContinueWith(t => task.ContinueWith(_ =>
{ {
// the previous task has finished execution or been cancelled, so we can run the provided continuation. // the previous task has finished execution or been cancelled, so we can run the provided continuation.

View File

@ -27,7 +27,7 @@ namespace osu.Game.Graphics.Containers.Markdown
{ {
switch (markdownObject) switch (markdownObject)
{ {
case YamlFrontMatterBlock _: case YamlFrontMatterBlock:
// Don't parse YAML Frontmatter // Don't parse YAML Frontmatter
break; break;

View File

@ -74,7 +74,7 @@ namespace osu.Game.Graphics.UserInterface
} }
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards //I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
RemoveRange(Children.Where((bar, index) => index >= value.Count()).ToList()); RemoveRange(Children.Where((_, index) => index >= value.Count()).ToList());
} }
} }
} }

View File

@ -55,12 +55,12 @@ namespace osu.Game.Graphics.UserInterface
switch (e) switch (e)
{ {
// blocking scroll can cause weird behaviour when this layer is used within a ScrollContainer. // blocking scroll can cause weird behaviour when this layer is used within a ScrollContainer.
case ScrollEvent _: case ScrollEvent:
return false; return false;
// blocking touch events causes the ISourcedFromTouch versions to not be fired, potentially impeding behaviour of drawables *above* the loading layer that may utilise these. // blocking touch events causes the ISourcedFromTouch versions to not be fired, potentially impeding behaviour of drawables *above* the loading layer that may utilise these.
// note that this will not work well if touch handling elements are beneath this loading layer (something to consider for the future). // note that this will not work well if touch handling elements are beneath this loading layer (something to consider for the future).
case TouchEvent _: case TouchEvent:
return false; return false;
} }

View File

@ -68,7 +68,7 @@ namespace osu.Game.Graphics.UserInterface
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(star_spacing), Spacing = new Vector2(star_spacing),
ChildrenEnumerable = Enumerable.Range(0, StarCount).Select(i => CreateStar()) ChildrenEnumerable = Enumerable.Range(0, StarCount).Select(_ => CreateStar())
} }
}; };
} }

View File

@ -51,7 +51,7 @@ namespace osu.Game.Input.Bindings
protected override void LoadComplete() protected override void LoadComplete()
{ {
realmSubscription = realm.RegisterForNotifications(queryRealmKeyBindings, (sender, changes, error) => realmSubscription = realm.RegisterForNotifications(queryRealmKeyBindings, (sender, _, _) =>
{ {
// The first fire of this is a bit redundant as this is being called in base.LoadComplete, // The first fire of this is a bit redundant as this is being called in base.LoadComplete,
// but this is safest in case the subscription is restored after a context recycle. // but this is safest in case the subscription is restored after a context recycle.

View File

@ -80,11 +80,11 @@ namespace osu.Game.Input
switch (e) switch (e)
{ {
case KeyDownEvent _: case KeyDownEvent:
case KeyUpEvent _: case KeyUpEvent:
case MouseDownEvent _: case MouseDownEvent:
case MouseUpEvent _: case MouseUpEvent:
case MouseMoveEvent _: case MouseMoveEvent:
return updateLastInteractionTime(); return updateLastInteractionTime();
default: default:

View File

@ -40,7 +40,7 @@ namespace osu.Game.Online
// Used to interact with manager classes that don't support interface types. Will eventually be replaced. // Used to interact with manager classes that don't support interface types. Will eventually be replaced.
var beatmapSetInfo = new BeatmapSetInfo { OnlineID = TrackedItem.OnlineID }; var beatmapSetInfo = new BeatmapSetInfo { OnlineID = TrackedItem.OnlineID };
realmSubscription = realm.RegisterForNotifications(r => r.All<BeatmapSetInfo>().Where(s => s.OnlineID == TrackedItem.OnlineID && !s.DeletePending), (items, changes, ___) => realmSubscription = realm.RegisterForNotifications(r => r.All<BeatmapSetInfo>().Where(s => s.OnlineID == TrackedItem.OnlineID && !s.DeletePending), (items, _, _) =>
{ {
if (items.Any()) if (items.Any())
Schedule(() => UpdateState(DownloadState.LocallyAvailable)); Schedule(() => UpdateState(DownloadState.LocallyAvailable));

View File

@ -465,7 +465,7 @@ namespace osu.Game.Online.Chat
default: default:
var req = new JoinChannelRequest(channel); var req = new JoinChannelRequest(channel);
req.Success += () => joinChannel(channel, fetchInitialMessages); req.Success += () => joinChannel(channel, fetchInitialMessages);
req.Failure += ex => LeaveChannel(channel); req.Failure += _ => LeaveChannel(channel);
api.Queue(req); api.Queue(req);
return channel; return channel;
} }

View File

@ -64,7 +64,7 @@ namespace osu.Game.Online
this.preferMessagePack = preferMessagePack; this.preferMessagePack = preferMessagePack;
apiState.BindTo(api.State); apiState.BindTo(api.State);
apiState.BindValueChanged(state => connectIfPossible(), true); apiState.BindValueChanged(_ => connectIfPossible(), true);
} }
public void Reconnect() public void Reconnect()

View File

@ -101,7 +101,7 @@ namespace osu.Game.Online.Rooms
// handles changes to hash that didn't occur from the import process (ie. a user editing the beatmap in the editor, somehow). // handles changes to hash that didn't occur from the import process (ie. a user editing the beatmap in the editor, somehow).
realmSubscription?.Dispose(); realmSubscription?.Dispose();
realmSubscription = realm.RegisterForNotifications(r => filteredBeatmaps(), (items, changes, ___) => realmSubscription = realm.RegisterForNotifications(_ => filteredBeatmaps(), (_, changes, _) =>
{ {
if (changes == null) if (changes == null)
return; return;

View File

@ -48,7 +48,7 @@ namespace osu.Game.Online
realmSubscription = realm.RegisterForNotifications(r => r.All<ScoreInfo>().Where(s => realmSubscription = realm.RegisterForNotifications(r => r.All<ScoreInfo>().Where(s =>
((s.OnlineID > 0 && s.OnlineID == TrackedItem.OnlineID) ((s.OnlineID > 0 && s.OnlineID == TrackedItem.OnlineID)
|| (!string.IsNullOrEmpty(s.Hash) && s.Hash == TrackedItem.Hash)) || (!string.IsNullOrEmpty(s.Hash) && s.Hash == TrackedItem.Hash))
&& !s.DeletePending), (items, changes, ___) => && !s.DeletePending), (items, _, _) =>
{ {
if (items.Any()) if (items.Any())
Schedule(() => UpdateState(DownloadState.LocallyAvailable)); Schedule(() => UpdateState(DownloadState.LocallyAvailable));

View File

@ -481,7 +481,7 @@ namespace osu.Game
{ {
switch (handler) switch (handler)
{ {
case MidiHandler _: case MidiHandler:
return new InputSection.HandlerSection(handler); return new InputSection.HandlerSection(handler);
// return null for handlers that shouldn't have settings. // return null for handlers that shouldn't have settings.

View File

@ -161,13 +161,13 @@ namespace osu.Game.Overlays.BeatmapListing
queueUpdateSearch(true); queueUpdateSearch(true);
}); });
searchControl.General.CollectionChanged += (_, __) => queueUpdateSearch(); searchControl.General.CollectionChanged += (_, _) => queueUpdateSearch();
searchControl.Ruleset.BindValueChanged(_ => queueUpdateSearch()); searchControl.Ruleset.BindValueChanged(_ => queueUpdateSearch());
searchControl.Category.BindValueChanged(_ => queueUpdateSearch()); searchControl.Category.BindValueChanged(_ => queueUpdateSearch());
searchControl.Genre.BindValueChanged(_ => queueUpdateSearch()); searchControl.Genre.BindValueChanged(_ => queueUpdateSearch());
searchControl.Language.BindValueChanged(_ => queueUpdateSearch()); searchControl.Language.BindValueChanged(_ => queueUpdateSearch());
searchControl.Extra.CollectionChanged += (_, __) => queueUpdateSearch(); searchControl.Extra.CollectionChanged += (_, _) => queueUpdateSearch();
searchControl.Ranks.CollectionChanged += (_, __) => queueUpdateSearch(); searchControl.Ranks.CollectionChanged += (_, _) => queueUpdateSearch();
searchControl.Played.BindValueChanged(_ => queueUpdateSearch()); searchControl.Played.BindValueChanged(_ => queueUpdateSearch());
searchControl.ExplicitContent.BindValueChanged(_ => queueUpdateSearch()); searchControl.ExplicitContent.BindValueChanged(_ => queueUpdateSearch());

View File

@ -156,7 +156,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
base.LoadComplete(); base.LoadComplete();
ruleset.ValueChanged += r => updateDisplay(); ruleset.ValueChanged += _ => updateDisplay();
// done here so everything can bind in intialization and get the first trigger // done here so everything can bind in intialization and get the first trigger
Beatmap.TriggerChange(); Beatmap.TriggerChange();

View File

@ -217,7 +217,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
scope.BindValueChanged(_ => getScores()); scope.BindValueChanged(_ => getScores());
ruleset.BindValueChanged(_ => getScores()); ruleset.BindValueChanged(_ => getScores());
modSelector.SelectedMods.CollectionChanged += (_, __) => getScores(); modSelector.SelectedMods.CollectionChanged += (_, _) => getScores();
Beatmap.BindValueChanged(onBeatmapChanged); Beatmap.BindValueChanged(onBeatmapChanged);
user.BindValueChanged(onUserChanged, true); user.BindValueChanged(onUserChanged, true);

View File

@ -117,7 +117,7 @@ namespace osu.Game.Overlays.Comments
} }
}); });
textBox.OnCommit += (u, v) => textBox.OnCommit += (_, _) =>
{ {
if (commitButton.IsBlocked.Value) if (commitButton.IsBlocked.Value)
return; return;

View File

@ -251,8 +251,8 @@ namespace osu.Game.Overlays.Comments
if (bundle.HasMore) if (bundle.HasMore)
{ {
int loadedTopLevelComments = 0; int loadedTopLevelComments = 0;
pinnedContent.Children.OfType<DrawableComment>().ForEach(p => loadedTopLevelComments++); pinnedContent.Children.OfType<DrawableComment>().ForEach(_ => loadedTopLevelComments++);
content.Children.OfType<DrawableComment>().ForEach(p => loadedTopLevelComments++); content.Children.OfType<DrawableComment>().ForEach(_ => loadedTopLevelComments++);
moreButton.Current.Value = bundle.TopLevelCount - loadedTopLevelComments; moreButton.Current.Value = bundle.TopLevelCount - loadedTopLevelComments;
moreButton.IsLoading = false; moreButton.IsLoading = false;

View File

@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Dashboard.Friends
controlBackground.Colour = colourProvider.Background5; controlBackground.Colour = colourProvider.Background5;
apiFriends.BindTo(api.Friends); apiFriends.BindTo(api.Friends);
apiFriends.BindCollectionChanged((_, __) => Schedule(() => Users = apiFriends.ToList()), true); apiFriends.BindCollectionChanged((_, _) => Schedule(() => Users = apiFriends.ToList()), true);
} }
protected override void LoadComplete() protected override void LoadComplete()

View File

@ -109,7 +109,7 @@ namespace osu.Game.Overlays.Login
} }
}; };
password.OnCommit += (sender, newText) => performLogin(); password.OnCommit += (_, _) => performLogin();
if (api?.LastLoginError?.Message is string error) if (api?.LastLoginError?.Message is string error)
errorText.AddErrors(new[] { error }); errorText.AddErrors(new[] { error });

View File

@ -112,7 +112,7 @@ namespace osu.Game.Overlays.MedalSplash
s.Font = s.Font.With(size: 16); s.Font = s.Font.With(size: 16);
}); });
medalContainer.OnLoadComplete += d => medalContainer.OnLoadComplete += _ =>
{ {
unlocked.Position = new Vector2(0f, medalContainer.DrawSize.Y / 2 + 10); unlocked.Position = new Vector2(0f, medalContainer.DrawSize.Y / 2 + 10);
infoFlow.Position = new Vector2(0f, unlocked.Position.Y + 90); infoFlow.Position = new Vector2(0f, unlocked.Position.Y + 90);

View File

@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Mods
/// </remarks> /// </remarks>
public Bindable<Dictionary<ModType, IReadOnlyList<ModState>>> AvailableMods { get; } = new Bindable<Dictionary<ModType, IReadOnlyList<ModState>>>(new Dictionary<ModType, IReadOnlyList<ModState>>()); public Bindable<Dictionary<ModType, IReadOnlyList<ModState>>> AvailableMods { get; } = new Bindable<Dictionary<ModType, IReadOnlyList<ModState>>>(new Dictionary<ModType, IReadOnlyList<ModState>>());
private Func<Mod, bool> isValidMod = m => true; private Func<Mod, bool> isValidMod = _ => true;
/// <summary> /// <summary>
/// A function determining whether each mod in the column should be displayed. /// A function determining whether each mod in the column should be displayed.
@ -689,11 +689,11 @@ namespace osu.Game.Overlays.Mods
switch (e) switch (e)
{ {
case ClickEvent _: case ClickEvent:
OnClicked?.Invoke(); OnClicked?.Invoke();
return true; return true;
case MouseEvent _: case MouseEvent:
return true; return true;
} }

View File

@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Music
}, },
}; };
filter.Search.OnCommit += (sender, newText) => filter.Search.OnCommit += (_, _) =>
{ {
list.FirstVisibleSet?.PerformRead(set => list.FirstVisibleSet?.PerformRead(set =>
{ {

Some files were not shown because too many files have changed in this diff Show More