mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 04:32:57 +08:00
Update parameter discards
This commit is contained in:
parent
30eebf3511
commit
31a447fda0
@ -57,7 +57,7 @@ namespace osu.Desktop
|
||||
client.OnReady += onReady;
|
||||
|
||||
// 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);
|
||||
|
||||
|
@ -129,18 +129,18 @@ namespace osu.Desktop
|
||||
[SupportedOSPlatform("windows")]
|
||||
private static void setupSquirrel()
|
||||
{
|
||||
SquirrelAwareApp.HandleEvents(onInitialInstall: (version, tools) =>
|
||||
SquirrelAwareApp.HandleEvents(onInitialInstall: (_, tools) =>
|
||||
{
|
||||
tools.CreateShortcutForThisExe();
|
||||
tools.CreateUninstallerRegistryEntry();
|
||||
}, onAppUpdate: (version, tools) =>
|
||||
}, onAppUpdate: (_, tools) =>
|
||||
{
|
||||
tools.CreateUninstallerRegistryEntry();
|
||||
}, onAppUninstall: (version, tools) =>
|
||||
}, onAppUninstall: (_, tools) =>
|
||||
{
|
||||
tools.RemoveShortcutForThisExe();
|
||||
tools.RemoveUninstallerRegistryEntry();
|
||||
}, onEveryRun: (version, tools, firstRun) =>
|
||||
}, onEveryRun: (_, _, _) =>
|
||||
{
|
||||
// While setting the `ProcessAppUserModelId` fixes duplicate icons/shortcuts on the taskbar, it currently
|
||||
// causes the right-click context menu to function incorrectly.
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Benchmarks
|
||||
|
||||
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 })));
|
||||
});
|
||||
|
@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
new JuiceStreamPathVertex(20, -5)
|
||||
}));
|
||||
|
||||
removeCount = path.RemoveVertices((_, i) => true);
|
||||
removeCount = path.RemoveVertices((_, _) => true);
|
||||
Assert.That(removeCount, Is.EqualTo(1));
|
||||
Assert.That(path.Vertices, Is.EqualTo(new[]
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
hyperDashCount = 0;
|
||||
|
||||
// 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();
|
||||
|
||||
|
@ -135,15 +135,15 @@ namespace osu.Game.Rulesets.Catch.Edit
|
||||
{
|
||||
switch (BlueprintContainer.CurrentTool)
|
||||
{
|
||||
case SelectTool _:
|
||||
case SelectTool:
|
||||
if (EditorBeatmap.SelectedHitObjects.Count == 0)
|
||||
return null;
|
||||
|
||||
double minTime = EditorBeatmap.SelectedHitObjects.Min(hitObject => hitObject.StartTime);
|
||||
return getLastSnappableHitObject(minTime);
|
||||
|
||||
case FruitCompositionTool _:
|
||||
case JuiceStreamCompositionTool _:
|
||||
case FruitCompositionTool:
|
||||
case JuiceStreamCompositionTool:
|
||||
if (!CursorInPlacementArea)
|
||||
return null;
|
||||
|
||||
|
@ -42,10 +42,10 @@ namespace osu.Game.Rulesets.Catch.Edit
|
||||
case Droplet droplet:
|
||||
return droplet is TinyDroplet ? PositionRange.EMPTY : new PositionRange(droplet.OriginalX);
|
||||
|
||||
case JuiceStream _:
|
||||
case JuiceStream:
|
||||
return GetPositionRange(hitObject.NestedHitObjects);
|
||||
|
||||
case BananaShower _:
|
||||
case BananaShower:
|
||||
// A banana shower occupies the whole screen width.
|
||||
return new PositionRange(0, CatchPlayfield.WIDTH);
|
||||
|
||||
|
@ -131,7 +131,7 @@ namespace osu.Game.Rulesets.Catch.Edit
|
||||
{
|
||||
switch (hitObject)
|
||||
{
|
||||
case BananaShower _:
|
||||
case BananaShower:
|
||||
return false;
|
||||
|
||||
case JuiceStream juiceStream:
|
||||
|
@ -389,13 +389,13 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
{
|
||||
switch (source)
|
||||
{
|
||||
case Fruit _:
|
||||
case Fruit:
|
||||
return caughtFruitPool.Get();
|
||||
|
||||
case Banana _:
|
||||
case Banana:
|
||||
return caughtBananaPool.Get();
|
||||
|
||||
case Droplet _:
|
||||
case Droplet:
|
||||
return caughtDropletPool.Get();
|
||||
|
||||
default:
|
||||
|
@ -173,7 +173,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
|
||||
|
||||
switch (original)
|
||||
{
|
||||
case IHasDistance _:
|
||||
case IHasDistance:
|
||||
{
|
||||
var generator = new DistanceObjectPatternGenerator(Random, original, beatmap, lastPattern, originalBeatmap);
|
||||
conversion = generator;
|
||||
|
@ -156,9 +156,9 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
{
|
||||
switch (m)
|
||||
{
|
||||
case ManiaModNoFail _:
|
||||
case ManiaModEasy _:
|
||||
case ManiaModHalfTime _:
|
||||
case ManiaModNoFail:
|
||||
case ManiaModEasy:
|
||||
case ManiaModHalfTime:
|
||||
scoreMultiplier *= 0.5;
|
||||
break;
|
||||
}
|
||||
|
@ -146,56 +146,56 @@ namespace osu.Game.Rulesets.Mania
|
||||
{
|
||||
switch (mod)
|
||||
{
|
||||
case ManiaModKey1 _:
|
||||
case ManiaModKey1:
|
||||
value |= LegacyMods.Key1;
|
||||
break;
|
||||
|
||||
case ManiaModKey2 _:
|
||||
case ManiaModKey2:
|
||||
value |= LegacyMods.Key2;
|
||||
break;
|
||||
|
||||
case ManiaModKey3 _:
|
||||
case ManiaModKey3:
|
||||
value |= LegacyMods.Key3;
|
||||
break;
|
||||
|
||||
case ManiaModKey4 _:
|
||||
case ManiaModKey4:
|
||||
value |= LegacyMods.Key4;
|
||||
break;
|
||||
|
||||
case ManiaModKey5 _:
|
||||
case ManiaModKey5:
|
||||
value |= LegacyMods.Key5;
|
||||
break;
|
||||
|
||||
case ManiaModKey6 _:
|
||||
case ManiaModKey6:
|
||||
value |= LegacyMods.Key6;
|
||||
break;
|
||||
|
||||
case ManiaModKey7 _:
|
||||
case ManiaModKey7:
|
||||
value |= LegacyMods.Key7;
|
||||
break;
|
||||
|
||||
case ManiaModKey8 _:
|
||||
case ManiaModKey8:
|
||||
value |= LegacyMods.Key8;
|
||||
break;
|
||||
|
||||
case ManiaModKey9 _:
|
||||
case ManiaModKey9:
|
||||
value |= LegacyMods.Key9;
|
||||
break;
|
||||
|
||||
case ManiaModDualStages _:
|
||||
case ManiaModDualStages:
|
||||
value |= LegacyMods.KeyCoop;
|
||||
break;
|
||||
|
||||
case ManiaModFadeIn _:
|
||||
case ManiaModFadeIn:
|
||||
value |= LegacyMods.FadeIn;
|
||||
value &= ~LegacyMods.Hidden; // this is toggled on in the base call due to inheritance, but we don't want that.
|
||||
break;
|
||||
|
||||
case ManiaModMirror _:
|
||||
case ManiaModMirror:
|
||||
value |= LegacyMods.Mirror;
|
||||
break;
|
||||
|
||||
case ManiaModRandom _:
|
||||
case ManiaModRandom:
|
||||
value |= LegacyMods.Random;
|
||||
break;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
||||
var rng = new Random((int)Seed.Value);
|
||||
|
||||
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]);
|
||||
}
|
||||
|
@ -57,11 +57,11 @@ namespace osu.Game.Rulesets.Mania.Replays
|
||||
{
|
||||
switch (point)
|
||||
{
|
||||
case HitPoint _:
|
||||
case HitPoint:
|
||||
actions.Add(columnActions[point.Column]);
|
||||
break;
|
||||
|
||||
case ReleasePoint _:
|
||||
case ReleasePoint:
|
||||
actions.Remove(columnActions[point.Column]);
|
||||
break;
|
||||
}
|
||||
|
@ -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.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
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
|
||||
lastResult = null;
|
||||
|
||||
spinner = nextSpinner;
|
||||
spinner.OnNewResult += (o, result) => lastResult = result;
|
||||
spinner.OnNewResult += (_, result) => lastResult = result;
|
||||
}
|
||||
|
||||
return lastResult?.Type == HitResult.Great;
|
||||
@ -116,7 +116,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
|
||||
return false;
|
||||
|
||||
spinner = nextSpinner;
|
||||
spinner.OnNewResult += (o, result) => results.Add(result);
|
||||
spinner.OnNewResult += (_, result) => results.Add(result);
|
||||
|
||||
results.Clear();
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
});
|
||||
|
||||
selectedHitObjects = EditorBeatmap.SelectedHitObjects.GetBoundCopy();
|
||||
selectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid();
|
||||
selectedHitObjects.CollectionChanged += (_, _) => updateDistanceSnapGrid();
|
||||
|
||||
placementObject = EditorBeatmap.PlacementObject.GetBoundCopy();
|
||||
placementObject.ValueChanged += _ => updateDistanceSnapGrid();
|
||||
@ -204,7 +204,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
switch (BlueprintContainer.CurrentTool)
|
||||
{
|
||||
case SelectTool _:
|
||||
case SelectTool:
|
||||
if (!EditorBeatmap.SelectedHitObjects.Any())
|
||||
return;
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
public void ApplyToDrawableHitObject(DrawableHitObject drawable)
|
||||
{
|
||||
drawable.ApplyCustomUpdateState += (drawableObject, state) =>
|
||||
drawable.ApplyCustomUpdateState += (drawableObject, _) =>
|
||||
{
|
||||
if (!(drawableObject is DrawableHitCircle drawableHitCircle)) return;
|
||||
|
||||
|
@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
switch (drawableObject)
|
||||
{
|
||||
case DrawableSliderTail _:
|
||||
case DrawableSliderTail:
|
||||
using (drawableObject.BeginAbsoluteSequence(fadeStartTime))
|
||||
drawableObject.FadeOut(fadeDuration);
|
||||
|
||||
@ -165,14 +165,14 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
switch (hitObject)
|
||||
{
|
||||
case Slider _:
|
||||
case Slider:
|
||||
return (fadeOutStartTime, longFadeDuration);
|
||||
|
||||
case SliderTick _:
|
||||
case SliderTick:
|
||||
double tickFadeOutDuration = Math.Min(hitObject.TimePreempt - DrawableSliderTick.ANIM_DURATION, 1000);
|
||||
return (hitObject.StartTime - tickFadeOutDuration, tickFadeOutDuration);
|
||||
|
||||
case Spinner _:
|
||||
case Spinner:
|
||||
return (fadeOutStartTime + longFadeDuration, fadeOutDuration);
|
||||
|
||||
default:
|
||||
|
@ -44,13 +44,13 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
// apply grow effect
|
||||
switch (drawable)
|
||||
{
|
||||
case DrawableSliderHead _:
|
||||
case DrawableSliderTail _:
|
||||
case DrawableSliderHead:
|
||||
case DrawableSliderTail:
|
||||
// special cases we should *not* be scaling.
|
||||
break;
|
||||
|
||||
case DrawableSlider _:
|
||||
case DrawableHitCircle _:
|
||||
case DrawableSlider:
|
||||
case DrawableHitCircle:
|
||||
{
|
||||
using (drawable.BeginAbsoluteSequence(h.StartTime - h.TimePreempt))
|
||||
drawable.ScaleTo(StartScale.Value).Then().ScaleTo(EndScale, h.TimePreempt, Easing.OutSine);
|
||||
|
@ -34,10 +34,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
switch (drawable)
|
||||
{
|
||||
case DrawableSliderHead _:
|
||||
case DrawableSliderTail _:
|
||||
case DrawableSliderTick _:
|
||||
case DrawableSliderRepeat _:
|
||||
case DrawableSliderHead:
|
||||
case DrawableSliderTail:
|
||||
case DrawableSliderTick:
|
||||
case DrawableSliderRepeat:
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -156,7 +156,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public Slider()
|
||||
{
|
||||
SamplesBindable.CollectionChanged += (_, __) => UpdateNestedSamples();
|
||||
SamplesBindable.CollectionChanged += (_, _) => UpdateNestedSamples();
|
||||
Path.Version.ValueChanged += _ => updateNestedPositions();
|
||||
}
|
||||
|
||||
|
@ -120,19 +120,19 @@ namespace osu.Game.Rulesets.Osu
|
||||
{
|
||||
switch (mod)
|
||||
{
|
||||
case OsuModAutopilot _:
|
||||
case OsuModAutopilot:
|
||||
value |= LegacyMods.Autopilot;
|
||||
break;
|
||||
|
||||
case OsuModSpunOut _:
|
||||
case OsuModSpunOut:
|
||||
value |= LegacyMods.SpunOut;
|
||||
break;
|
||||
|
||||
case OsuModTarget _:
|
||||
case OsuModTarget:
|
||||
value |= LegacyMods.Target;
|
||||
break;
|
||||
|
||||
case OsuModTouchDevice _:
|
||||
case OsuModTouchDevice:
|
||||
value |= LegacyMods.TouchDevice;
|
||||
break;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
hitWindows = slider.TailCircle.HitWindows;
|
||||
break;
|
||||
|
||||
case Spinner _:
|
||||
case Spinner:
|
||||
hitWindows = defaultHitWindows;
|
||||
break;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
||||
{
|
||||
switch (hitObject)
|
||||
{
|
||||
case HitCircle _:
|
||||
case HitCircle:
|
||||
return new OsuHitCircleJudgementResult(hitObject, judgement);
|
||||
|
||||
default:
|
||||
|
@ -126,7 +126,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||
|
||||
break;
|
||||
|
||||
case DrawableSpinnerBonusTick _:
|
||||
case DrawableSpinnerBonusTick:
|
||||
if (state == ArmedState.Hit)
|
||||
glow.FlashColour(Color4.White, 200);
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
switch (obj)
|
||||
{
|
||||
case DrawableSpinner _:
|
||||
case DrawableSpinner:
|
||||
continue;
|
||||
|
||||
case DrawableSlider slider:
|
||||
|
@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
// note: `Slider`'s `ProxiedLayer` is added when its nested `DrawableHitCircle` is loaded.
|
||||
switch (drawable)
|
||||
{
|
||||
case DrawableSpinner _:
|
||||
case DrawableSpinner:
|
||||
spinnerProxies.Add(drawable.CreateProxy());
|
||||
break;
|
||||
|
||||
|
@ -88,11 +88,11 @@ namespace osu.Game.Rulesets.Osu.Utils
|
||||
|
||||
switch (hitObject)
|
||||
{
|
||||
case HitCircle _:
|
||||
case HitCircle:
|
||||
shift = clampHitCircleToPlayfield(current);
|
||||
break;
|
||||
|
||||
case Slider _:
|
||||
case Slider:
|
||||
shift = clampSliderToPlayfield(current);
|
||||
break;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
||||
AddStep("Setup judgements", () =>
|
||||
{
|
||||
judged = false;
|
||||
Player.ScoreProcessor.NewJudgement += b => judged = true;
|
||||
Player.ScoreProcessor.NewJudgement += _ => judged = true;
|
||||
});
|
||||
AddUntilStep("swell judged", () => judged);
|
||||
AddAssert("failed", () => Player.GameplayState.HasFailed);
|
||||
|
@ -48,8 +48,8 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
switch (hitObject)
|
||||
{
|
||||
case DrawableDrumRollTick _:
|
||||
case DrawableHit _:
|
||||
case DrawableDrumRollTick:
|
||||
case DrawableHit:
|
||||
double preempt = drawableRuleset.TimeRange.Value / drawableRuleset.ControlPointAt(hitObject.HitObject.StartTime).Multiplier;
|
||||
double start = hitObject.HitObject.StartTime - preempt * fade_out_start_time;
|
||||
double duration = preempt * fade_out_duration;
|
||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
||||
DisplayColour.Value = Type == HitType.Centre ? COLOUR_CENTRE : COLOUR_RIM;
|
||||
});
|
||||
|
||||
SamplesBindable.BindCollectionChanged((_, __) => updateTypeFromSamples());
|
||||
SamplesBindable.BindCollectionChanged((_, _) => updateTypeFromSamples());
|
||||
}
|
||||
|
||||
private void updateTypeFromSamples()
|
||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
||||
protected TaikoStrongableHitObject()
|
||||
{
|
||||
IsStrongBindable.BindValueChanged(_ => updateSamplesFromType());
|
||||
SamplesBindable.BindCollectionChanged((_, __) => updateTypeFromSamples());
|
||||
SamplesBindable.BindCollectionChanged((_, _) => updateTypeFromSamples());
|
||||
}
|
||||
|
||||
private void updateTypeFromSamples()
|
||||
|
@ -245,7 +245,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
barLinePlayfield.Add(barLine);
|
||||
break;
|
||||
|
||||
case DrawableTaikoHitObject _:
|
||||
case DrawableTaikoHitObject:
|
||||
base.Add(h);
|
||||
break;
|
||||
|
||||
@ -261,7 +261,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
case DrawableBarLine barLine:
|
||||
return barLinePlayfield.Remove(barLine);
|
||||
|
||||
case DrawableTaikoHitObject _:
|
||||
case DrawableTaikoHitObject:
|
||||
return base.Remove(h);
|
||||
|
||||
default:
|
||||
@ -280,12 +280,12 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
|
||||
switch (result.Judgement)
|
||||
{
|
||||
case TaikoStrongJudgement _:
|
||||
case TaikoStrongJudgement:
|
||||
if (result.IsHit)
|
||||
hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == ((DrawableStrongNestedHit)judgedObject).ParentHitObject)?.VisualiseSecondHit(result);
|
||||
break;
|
||||
|
||||
case TaikoDrumRollTickJudgement _:
|
||||
case TaikoDrumRollTickJudgement:
|
||||
if (!result.IsHit)
|
||||
break;
|
||||
|
||||
|
@ -99,7 +99,7 @@ namespace osu.Game.Tests.Collections.IO
|
||||
public async Task TestImportMalformedDatabase()
|
||||
{
|
||||
bool exceptionThrown = false;
|
||||
UnhandledExceptionEventHandler setException = (_, __) => exceptionThrown = true;
|
||||
UnhandledExceptionEventHandler setException = (_, _) => exceptionThrown = true;
|
||||
|
||||
using (HeadlessGameHost host = new CleanRunHeadlessGameHost())
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Database
|
||||
|
||||
realm.RegisterCustomSubscription(r =>
|
||||
{
|
||||
var subscription = r.All<BeatmapInfo>().QueryAsyncWithNotifications((sender, changes, error) =>
|
||||
var subscription = r.All<BeatmapInfo>().QueryAsyncWithNotifications((_, _, _) =>
|
||||
{
|
||||
realm.Run(_ =>
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ namespace osu.Game.Tests.Database
|
||||
});
|
||||
|
||||
// Can't be used, even from within a valid context.
|
||||
realm.Run(threadContext =>
|
||||
realm.Run(_ =>
|
||||
{
|
||||
Assert.Throws<InvalidOperationException>(() =>
|
||||
{
|
||||
|
@ -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.
|
||||
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);
|
||||
|
@ -322,8 +322,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
switch (h)
|
||||
{
|
||||
case TestPooledHitObject _:
|
||||
case TestPooledParentHitObject _:
|
||||
case TestPooledHitObject:
|
||||
case TestPooledParentHitObject:
|
||||
return null;
|
||||
|
||||
case TestParentHitObject p:
|
||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
HealthProcessor.FailConditions += (_, __) => true;
|
||||
HealthProcessor.FailConditions += (_, _) => true;
|
||||
}
|
||||
|
||||
private double lastFrequency = double.MaxValue;
|
||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
HealthProcessor.FailConditions += (_, __) => true;
|
||||
HealthProcessor.FailConditions += (_, _) => true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
[Test]
|
||||
public void TestToggleEditor()
|
||||
{
|
||||
AddToggleStep("toggle editor visibility", visible => skinEditor.ToggleVisibility());
|
||||
AddToggleStep("toggle editor visibility", _ => skinEditor.ToggleVisibility());
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -103,7 +103,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
Child = new SkinProvidingContainer(secondarySource)
|
||||
{
|
||||
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("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);
|
||||
AddStep("disable", () => target.Disable());
|
||||
AddAssert("consumer using base source", () => consumer.Drawable is BaseSourceBox);
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
base.SetUpSteps();
|
||||
AddStep("enable storyboard", () => LocalConfig.SetValue(OsuSetting.ShowStoryboard, true));
|
||||
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 ShowResults = true", () => showResults = true);
|
||||
}
|
||||
@ -91,7 +91,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
CreateTest(() =>
|
||||
{
|
||||
AddStep("fail on first judgement", () => currentFailConditions = (_, __) => true);
|
||||
AddStep("fail on first judgement", () => currentFailConditions = (_, _) => true);
|
||||
|
||||
// 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.
|
||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
// To emulate `MultiplayerClient.CurrentMatchPlayingUserIds` we need a bindable list of *only IDs*.
|
||||
// This tracks the list of users 1:1.
|
||||
MultiplayerUsers.BindCollectionChanged((c, e) =>
|
||||
MultiplayerUsers.BindCollectionChanged((_, e) =>
|
||||
{
|
||||
switch (e.Action)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
var mockLounge = new Mock<LoungeSubScreen>();
|
||||
mockLounge
|
||||
.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(() =>
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
setRoomCountdown(countdownStart.Duration);
|
||||
break;
|
||||
|
||||
case StopCountdownRequest _:
|
||||
case StopCountdownRequest:
|
||||
multiplayerRoom.Countdown = null;
|
||||
raiseRoomUpdated();
|
||||
break;
|
||||
|
@ -219,7 +219,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Metadata.BindValueChanged(metadata =>
|
||||
Metadata.BindValueChanged(_ =>
|
||||
{
|
||||
foreach (var b in this.ChildrenOfType<YearButton>())
|
||||
b.Action = () => YearChanged?.Invoke(b.Year);
|
||||
|
@ -187,8 +187,8 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
// pre-check for requests we should be handling (as they are scheduled below).
|
||||
switch (request)
|
||||
{
|
||||
case ShowPlaylistUserScoreRequest _:
|
||||
case IndexPlaylistScoresRequest _:
|
||||
case ShowPlaylistUserScoreRequest:
|
||||
case IndexPlaylistScoresRequest:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual.Settings
|
||||
public void ToggleVisibility()
|
||||
{
|
||||
AddWaitStep("wait some", 5);
|
||||
AddToggleStep("toggle visibility", visible => settings.ToggleVisibility());
|
||||
AddToggleStep("toggle visibility", _ => settings.ToggleVisibility());
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -91,19 +91,19 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
switch (instance)
|
||||
{
|
||||
case OsuRuleset _:
|
||||
case OsuRuleset:
|
||||
testInfoLabels(5);
|
||||
break;
|
||||
|
||||
case TaikoRuleset _:
|
||||
case TaikoRuleset:
|
||||
testInfoLabels(5);
|
||||
break;
|
||||
|
||||
case CatchRuleset _:
|
||||
case CatchRuleset:
|
||||
testInfoLabels(5);
|
||||
break;
|
||||
|
||||
case ManiaRuleset _:
|
||||
case ManiaRuleset:
|
||||
testInfoLabels(4);
|
||||
break;
|
||||
|
||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
AddStep("Set time before zero", () =>
|
||||
{
|
||||
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) =>
|
||||
beatContainer.NewBeat = (i, timingControlPoint, _, _) =>
|
||||
{
|
||||
lastActuationTime = gameplayClockContainer.CurrentTime;
|
||||
lastTimingPoint = timingControlPoint;
|
||||
@ -105,7 +105,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
AddStep("Set time before zero", () =>
|
||||
{
|
||||
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) =>
|
||||
beatContainer.NewBeat = (i, timingControlPoint, _, _) =>
|
||||
{
|
||||
lastBeatIndex = i;
|
||||
lastBpm = timingControlPoint.BPM;
|
||||
@ -126,7 +126,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
AddStep("bind event", () =>
|
||||
{
|
||||
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) => lastBpm = timingControlPoint.BPM;
|
||||
beatContainer.NewBeat = (_, timingControlPoint, _, _) => lastBpm = timingControlPoint.BPM;
|
||||
});
|
||||
|
||||
AddUntilStep("wait for trigger", () => lastBpm != null);
|
||||
@ -157,7 +157,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
actualEffectPoint = null;
|
||||
beatContainer.AllowMistimedEventFiring = false;
|
||||
|
||||
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) =>
|
||||
beatContainer.NewBeat = (_, _, effectControlPoint, _) =>
|
||||
{
|
||||
if (Precision.AlmostEquals(gameplayClockContainer.CurrentTime + earlyActivationMilliseconds, expectedEffectPoint.Time, BeatSyncedContainer.MISTIMED_ALLOWANCE))
|
||||
actualEffectPoint = effectControlPoint;
|
||||
|
@ -77,13 +77,13 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
};
|
||||
|
||||
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.Category.BindValueChanged(c => category.Text = $"Category: {c.NewValue}", true);
|
||||
control.Genre.BindValueChanged(g => genre.Text = $"Genre: {g.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.Ranks.BindCollectionChanged((u, v) => ranks.Text = $"Ranks: {(control.Ranks.Any() ? string.Join('.', control.Ranks.Select(i => i.ToString())) : "")}", true);
|
||||
control.Extra.BindCollectionChanged((_, _) => extra.Text = $"Extra: {(control.Extra.Any() ? string.Join('.', control.Extra.Select(i => i.ToString().ToLowerInvariant())) : "")}", 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.ExplicitContent.BindValueChanged(e => explicitMap.Text = $"Explicit Maps: {e.NewValue}", true);
|
||||
});
|
||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
notificationOverlay.Reset();
|
||||
|
||||
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>()))
|
||||
.Callback((Notification n) => lastNotification = n);
|
||||
|
@ -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));
|
||||
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));
|
||||
AddAssert("nightcore still visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(b => b.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value));
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
base.Current = new Bindable<string>(string.Empty);
|
||||
|
||||
((OsuTextBox)Control).OnCommit += (sender, newText) =>
|
||||
((OsuTextBox)Control).OnCommit += (sender, _) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Tournament.Components
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
|
||||
AddInternal(rightClickMessage = new WarningBox("Right click to place and link matches"));
|
||||
|
||||
LadderInfo.Matches.CollectionChanged += (_, __) => updateMessage();
|
||||
LadderInfo.Matches.CollectionChanged += (_, _) => updateMessage();
|
||||
updateMessage();
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
||||
};
|
||||
|
||||
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.BindValueChanged(n => textDescription.Text = round.Description.Value?.ToUpperInvariant(), true);
|
||||
description.BindValueChanged(_ => textDescription.Text = round.Description.Value?.ToUpperInvariant(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ namespace osu.Game.Tournament.Screens.Ladder
|
||||
foreach (var match in LadderInfo.Matches)
|
||||
addMatch(match);
|
||||
|
||||
LadderInfo.Rounds.CollectionChanged += (_, __) => layout.Invalidate();
|
||||
LadderInfo.Rounds.CollectionChanged += (_, _) => layout.Invalidate();
|
||||
LadderInfo.Matches.CollectionChanged += (_, args) =>
|
||||
{
|
||||
switch (args.Action)
|
||||
|
@ -137,7 +137,7 @@ namespace osu.Game.Tournament
|
||||
heightWarning.Alpha = size.NewValue.Width < minWidth ? 1 : 0;
|
||||
}), true);
|
||||
|
||||
windowMode.BindValueChanged(mode => ScheduleAfterChildren(() =>
|
||||
windowMode.BindValueChanged(_ => ScheduleAfterChildren(() =>
|
||||
{
|
||||
windowMode.Value = WindowMode.Windowed;
|
||||
}), true);
|
||||
|
@ -267,7 +267,7 @@ namespace osu.Game.Tournament
|
||||
}
|
||||
else
|
||||
{
|
||||
req.Success += res => { populate(); };
|
||||
req.Success += _ => { populate(); };
|
||||
req.Failure += _ =>
|
||||
{
|
||||
user.OnlineID = 1;
|
||||
|
@ -204,12 +204,12 @@ namespace osu.Game.Tournament
|
||||
|
||||
switch (currentScreen)
|
||||
{
|
||||
case MapPoolScreen _:
|
||||
case MapPoolScreen:
|
||||
chatContainer.FadeIn(TournamentScreen.FADE_DELAY);
|
||||
chatContainer.ResizeWidthTo(1, 500, Easing.OutQuint);
|
||||
break;
|
||||
|
||||
case GameplayScreen _:
|
||||
case GameplayScreen:
|
||||
chatContainer.FadeIn(TournamentScreen.FADE_DELAY);
|
||||
chatContainer.ResizeWidthTo(0.5f, 500, Easing.OutQuint);
|
||||
break;
|
||||
|
@ -254,12 +254,12 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
|
||||
switch (newPoint)
|
||||
{
|
||||
case TimingControlPoint _:
|
||||
case TimingControlPoint:
|
||||
// Timing points are a special case and need to be added regardless of fallback availability.
|
||||
existing = BinarySearch(TimingPoints, time);
|
||||
break;
|
||||
|
||||
case EffectControlPoint _:
|
||||
case EffectControlPoint:
|
||||
existing = EffectPointAt(time);
|
||||
break;
|
||||
}
|
||||
|
@ -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.
|
||||
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 { }
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
public static void Register()
|
||||
{
|
||||
AddDecoder<Beatmap>("{", m => new JsonBeatmapDecoder());
|
||||
AddDecoder<Beatmap>("{", _ => new JsonBeatmapDecoder());
|
||||
}
|
||||
|
||||
protected override void ParseStreamInto(LineBufferedReader stream, Beatmap output)
|
||||
|
@ -373,11 +373,11 @@ namespace osu.Game.Beatmaps.Formats
|
||||
|
||||
switch (hitObject)
|
||||
{
|
||||
case IHasPath _:
|
||||
case IHasPath:
|
||||
type |= LegacyHitObjectType.Slider;
|
||||
break;
|
||||
|
||||
case IHasDuration _:
|
||||
case IHasDuration:
|
||||
if (onlineRulesetID == 3)
|
||||
type |= LegacyHitObjectType.Hold;
|
||||
else
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
// note that this isn't completely correct
|
||||
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());
|
||||
}
|
||||
|
||||
|
@ -56,12 +56,12 @@ namespace osu.Game.Beatmaps.Legacy
|
||||
{
|
||||
switch (newPoint)
|
||||
{
|
||||
case SampleControlPoint _:
|
||||
case SampleControlPoint:
|
||||
// intentionally don't use SamplePointAt (we always need to consider the first sample point).
|
||||
var existing = BinarySearch(SamplePoints, time);
|
||||
return newPoint.IsRedundant(existing);
|
||||
|
||||
case DifficultyControlPoint _:
|
||||
case DifficultyControlPoint:
|
||||
return newPoint.IsRedundant(DifficultyPointAt(time));
|
||||
|
||||
default:
|
||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Collections
|
||||
|
||||
public BeatmapCollection()
|
||||
{
|
||||
BeatmapHashes.CollectionChanged += (_, __) => onChange();
|
||||
BeatmapHashes.CollectionChanged += (_, _) => onChange();
|
||||
Name.ValueChanged += _ => onChange();
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Collections
|
||||
// An extra bindable is enough to subvert this behaviour.
|
||||
base.Current = Current;
|
||||
|
||||
collections.BindCollectionChanged((_, __) => collectionsChanged(), true);
|
||||
collections.BindCollectionChanged((_, _) => collectionsChanged(), true);
|
||||
Current.BindValueChanged(filterChanged, true);
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ namespace osu.Game.Collections
|
||||
|
||||
if (collectionBeatmaps != null)
|
||||
{
|
||||
collectionBeatmaps.CollectionChanged += (_, __) => collectionChanged();
|
||||
collectionBeatmaps.CollectionChanged += (_, _) => collectionChanged();
|
||||
beatmap.BindValueChanged(_ => collectionChanged(), true);
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,7 @@ namespace osu.Game.Collections
|
||||
private void backgroundSave()
|
||||
{
|
||||
int current = Interlocked.Increment(ref lastSave);
|
||||
Task.Delay(100).ContinueWith(task =>
|
||||
Task.Delay(100).ContinueWith(_ =>
|
||||
{
|
||||
if (current != lastSave)
|
||||
return;
|
||||
|
@ -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)
|
||||
where TModel : RealmObjectBase
|
||||
{
|
||||
return RegisterCustomSubscription(r =>
|
||||
return RegisterCustomSubscription(_ =>
|
||||
{
|
||||
string propertyName = getMemberName(propertyLookup);
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
private static readonly IMapper write_mapper = new MapperConfiguration(c =>
|
||||
{
|
||||
c.ShouldMapField = fi => false;
|
||||
c.ShouldMapField = _ => false;
|
||||
c.ShouldMapProperty = pi => pi.SetMethod?.IsPublic == true;
|
||||
|
||||
c.CreateMap<BeatmapMetadata, BeatmapMetadata>()
|
||||
@ -70,7 +70,7 @@ namespace osu.Game.Database
|
||||
}
|
||||
});
|
||||
|
||||
c.Internal().ForAllMaps((typeMap, expression) =>
|
||||
c.Internal().ForAllMaps((_, expression) =>
|
||||
{
|
||||
expression.ForAllMembers(m =>
|
||||
{
|
||||
@ -87,7 +87,7 @@ namespace osu.Game.Database
|
||||
c.CreateMap<BeatmapSetInfo, BeatmapSetInfo>()
|
||||
.ConstructUsing(_ => new BeatmapSetInfo(null))
|
||||
.MaxDepth(2)
|
||||
.AfterMap((s, d) =>
|
||||
.AfterMap((_, d) =>
|
||||
{
|
||||
foreach (var beatmap in d.Beatmaps)
|
||||
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.
|
||||
c.CreateMap<BeatmapInfo, BeatmapInfo>()
|
||||
.MaxDepth(2)
|
||||
.AfterMap((s, d) =>
|
||||
.AfterMap((_, d) =>
|
||||
{
|
||||
for (int i = 0; i < d.BeatmapSet?.Beatmaps.Count; i++)
|
||||
{
|
||||
@ -121,7 +121,7 @@ namespace osu.Game.Database
|
||||
.ConstructUsing(_ => new BeatmapSetInfo(null))
|
||||
.MaxDepth(2)
|
||||
.ForMember(b => b.Files, cc => cc.Ignore())
|
||||
.AfterMap((s, d) =>
|
||||
.AfterMap((_, d) =>
|
||||
{
|
||||
foreach (var beatmap in d.Beatmaps)
|
||||
beatmap.BeatmapSet = d;
|
||||
@ -135,14 +135,14 @@ namespace osu.Game.Database
|
||||
|
||||
private static void applyCommonConfiguration(IMapperConfigurationExpression c)
|
||||
{
|
||||
c.ShouldMapField = fi => false;
|
||||
c.ShouldMapField = _ => false;
|
||||
|
||||
// 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<>.
|
||||
// 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.Internal().ForAllMaps((typeMap, expression) =>
|
||||
c.Internal().ForAllMaps((_, expression) =>
|
||||
{
|
||||
expression.ForAllMembers(m =>
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Extensions
|
||||
{
|
||||
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.
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
{
|
||||
switch (markdownObject)
|
||||
{
|
||||
case YamlFrontMatterBlock _:
|
||||
case YamlFrontMatterBlock:
|
||||
// Don't parse YAML Frontmatter
|
||||
break;
|
||||
|
||||
|
@ -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
|
||||
RemoveRange(Children.Where((bar, index) => index >= value.Count()).ToList());
|
||||
RemoveRange(Children.Where((_, index) => index >= value.Count()).ToList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,12 +55,12 @@ namespace osu.Game.Graphics.UserInterface
|
||||
switch (e)
|
||||
{
|
||||
// blocking scroll can cause weird behaviour when this layer is used within a ScrollContainer.
|
||||
case ScrollEvent _:
|
||||
case ScrollEvent:
|
||||
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.
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(star_spacing),
|
||||
ChildrenEnumerable = Enumerable.Range(0, StarCount).Select(i => CreateStar())
|
||||
ChildrenEnumerable = Enumerable.Range(0, StarCount).Select(_ => CreateStar())
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Input.Bindings
|
||||
|
||||
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,
|
||||
// but this is safest in case the subscription is restored after a context recycle.
|
||||
|
@ -80,11 +80,11 @@ namespace osu.Game.Input
|
||||
|
||||
switch (e)
|
||||
{
|
||||
case KeyDownEvent _:
|
||||
case KeyUpEvent _:
|
||||
case MouseDownEvent _:
|
||||
case MouseUpEvent _:
|
||||
case MouseMoveEvent _:
|
||||
case KeyDownEvent:
|
||||
case KeyUpEvent:
|
||||
case MouseDownEvent:
|
||||
case MouseUpEvent:
|
||||
case MouseMoveEvent:
|
||||
return updateLastInteractionTime();
|
||||
|
||||
default:
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Online
|
||||
// Used to interact with manager classes that don't support interface types. Will eventually be replaced.
|
||||
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())
|
||||
Schedule(() => UpdateState(DownloadState.LocallyAvailable));
|
||||
|
@ -465,7 +465,7 @@ namespace osu.Game.Online.Chat
|
||||
default:
|
||||
var req = new JoinChannelRequest(channel);
|
||||
req.Success += () => joinChannel(channel, fetchInitialMessages);
|
||||
req.Failure += ex => LeaveChannel(channel);
|
||||
req.Failure += _ => LeaveChannel(channel);
|
||||
api.Queue(req);
|
||||
return channel;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Online
|
||||
this.preferMessagePack = preferMessagePack;
|
||||
|
||||
apiState.BindTo(api.State);
|
||||
apiState.BindValueChanged(state => connectIfPossible(), true);
|
||||
apiState.BindValueChanged(_ => connectIfPossible(), true);
|
||||
}
|
||||
|
||||
public void Reconnect()
|
||||
|
@ -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).
|
||||
realmSubscription?.Dispose();
|
||||
realmSubscription = realm.RegisterForNotifications(r => filteredBeatmaps(), (items, changes, ___) =>
|
||||
realmSubscription = realm.RegisterForNotifications(_ => filteredBeatmaps(), (_, changes, _) =>
|
||||
{
|
||||
if (changes == null)
|
||||
return;
|
||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Online
|
||||
realmSubscription = realm.RegisterForNotifications(r => r.All<ScoreInfo>().Where(s =>
|
||||
((s.OnlineID > 0 && s.OnlineID == TrackedItem.OnlineID)
|
||||
|| (!string.IsNullOrEmpty(s.Hash) && s.Hash == TrackedItem.Hash))
|
||||
&& !s.DeletePending), (items, changes, ___) =>
|
||||
&& !s.DeletePending), (items, _, _) =>
|
||||
{
|
||||
if (items.Any())
|
||||
Schedule(() => UpdateState(DownloadState.LocallyAvailable));
|
||||
|
@ -481,7 +481,7 @@ namespace osu.Game
|
||||
{
|
||||
switch (handler)
|
||||
{
|
||||
case MidiHandler _:
|
||||
case MidiHandler:
|
||||
return new InputSection.HandlerSection(handler);
|
||||
|
||||
// return null for handlers that shouldn't have settings.
|
||||
|
@ -161,13 +161,13 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
queueUpdateSearch(true);
|
||||
});
|
||||
|
||||
searchControl.General.CollectionChanged += (_, __) => queueUpdateSearch();
|
||||
searchControl.General.CollectionChanged += (_, _) => queueUpdateSearch();
|
||||
searchControl.Ruleset.BindValueChanged(_ => queueUpdateSearch());
|
||||
searchControl.Category.BindValueChanged(_ => queueUpdateSearch());
|
||||
searchControl.Genre.BindValueChanged(_ => queueUpdateSearch());
|
||||
searchControl.Language.BindValueChanged(_ => queueUpdateSearch());
|
||||
searchControl.Extra.CollectionChanged += (_, __) => queueUpdateSearch();
|
||||
searchControl.Ranks.CollectionChanged += (_, __) => queueUpdateSearch();
|
||||
searchControl.Extra.CollectionChanged += (_, _) => queueUpdateSearch();
|
||||
searchControl.Ranks.CollectionChanged += (_, _) => queueUpdateSearch();
|
||||
searchControl.Played.BindValueChanged(_ => queueUpdateSearch());
|
||||
searchControl.ExplicitContent.BindValueChanged(_ => queueUpdateSearch());
|
||||
|
||||
|
@ -156,7 +156,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ruleset.ValueChanged += r => updateDisplay();
|
||||
ruleset.ValueChanged += _ => updateDisplay();
|
||||
|
||||
// done here so everything can bind in intialization and get the first trigger
|
||||
Beatmap.TriggerChange();
|
||||
|
@ -217,7 +217,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
scope.BindValueChanged(_ => getScores());
|
||||
ruleset.BindValueChanged(_ => getScores());
|
||||
|
||||
modSelector.SelectedMods.CollectionChanged += (_, __) => getScores();
|
||||
modSelector.SelectedMods.CollectionChanged += (_, _) => getScores();
|
||||
|
||||
Beatmap.BindValueChanged(onBeatmapChanged);
|
||||
user.BindValueChanged(onUserChanged, true);
|
||||
|
@ -117,7 +117,7 @@ namespace osu.Game.Overlays.Comments
|
||||
}
|
||||
});
|
||||
|
||||
textBox.OnCommit += (u, v) =>
|
||||
textBox.OnCommit += (_, _) =>
|
||||
{
|
||||
if (commitButton.IsBlocked.Value)
|
||||
return;
|
||||
|
@ -251,8 +251,8 @@ namespace osu.Game.Overlays.Comments
|
||||
if (bundle.HasMore)
|
||||
{
|
||||
int loadedTopLevelComments = 0;
|
||||
pinnedContent.Children.OfType<DrawableComment>().ForEach(p => loadedTopLevelComments++);
|
||||
content.Children.OfType<DrawableComment>().ForEach(p => loadedTopLevelComments++);
|
||||
pinnedContent.Children.OfType<DrawableComment>().ForEach(_ => loadedTopLevelComments++);
|
||||
content.Children.OfType<DrawableComment>().ForEach(_ => loadedTopLevelComments++);
|
||||
|
||||
moreButton.Current.Value = bundle.TopLevelCount - loadedTopLevelComments;
|
||||
moreButton.IsLoading = false;
|
||||
|
@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Dashboard.Friends
|
||||
controlBackground.Colour = colourProvider.Background5;
|
||||
|
||||
apiFriends.BindTo(api.Friends);
|
||||
apiFriends.BindCollectionChanged((_, __) => Schedule(() => Users = apiFriends.ToList()), true);
|
||||
apiFriends.BindCollectionChanged((_, _) => Schedule(() => Users = apiFriends.ToList()), true);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
@ -109,7 +109,7 @@ namespace osu.Game.Overlays.Login
|
||||
}
|
||||
};
|
||||
|
||||
password.OnCommit += (sender, newText) => performLogin();
|
||||
password.OnCommit += (_, _) => performLogin();
|
||||
|
||||
if (api?.LastLoginError?.Message is string error)
|
||||
errorText.AddErrors(new[] { error });
|
||||
|
@ -112,7 +112,7 @@ namespace osu.Game.Overlays.MedalSplash
|
||||
s.Font = s.Font.With(size: 16);
|
||||
});
|
||||
|
||||
medalContainer.OnLoadComplete += d =>
|
||||
medalContainer.OnLoadComplete += _ =>
|
||||
{
|
||||
unlocked.Position = new Vector2(0f, medalContainer.DrawSize.Y / 2 + 10);
|
||||
infoFlow.Position = new Vector2(0f, unlocked.Position.Y + 90);
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Mods
|
||||
/// </remarks>
|
||||
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>
|
||||
/// A function determining whether each mod in the column should be displayed.
|
||||
@ -689,11 +689,11 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
switch (e)
|
||||
{
|
||||
case ClickEvent _:
|
||||
case ClickEvent:
|
||||
OnClicked?.Invoke();
|
||||
return true;
|
||||
|
||||
case MouseEvent _:
|
||||
case MouseEvent:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Music
|
||||
},
|
||||
};
|
||||
|
||||
filter.Search.OnCommit += (sender, newText) =>
|
||||
filter.Search.OnCommit += (_, _) =>
|
||||
{
|
||||
list.FirstVisibleSet?.PerformRead(set =>
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user