From 8e20eed4ef2783234e54101fd0fa8bd92d5e11fe Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Tue, 30 Jan 2024 03:19:27 +0300 Subject: [PATCH] Don't use LINQ in ReceivePositionalInputAt --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 11 ++++++++++- osu.Game.Rulesets.Mania/UI/Stage.cs | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index c8874c8ab3..0d36f51943 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -42,7 +42,16 @@ namespace osu.Game.Rulesets.Mania.UI } } - public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => stages.Any(s => s.ReceivePositionalInputAt(screenSpacePos)); + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) + { + foreach (var s in stages) + { + if (s.ReceivePositionalInputAt(screenSpacePos)) + return true; + } + + return false; + } public ManiaPlayfield(List stageDefinitions) { diff --git a/osu.Game.Rulesets.Mania/UI/Stage.cs b/osu.Game.Rulesets.Mania/UI/Stage.cs index db06f9dbde..a4a09c9a82 100644 --- a/osu.Game.Rulesets.Mania/UI/Stage.cs +++ b/osu.Game.Rulesets.Mania/UI/Stage.cs @@ -44,7 +44,16 @@ namespace osu.Game.Rulesets.Mania.UI private readonly Drawable barLineContainer; - public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Columns.Any(c => c.ReceivePositionalInputAt(screenSpacePos)); + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) + { + foreach (var c in Columns) + { + if (c.ReceivePositionalInputAt(screenSpacePos)) + return true; + } + + return false; + } private readonly int firstColumnIndex;