From b7239757670ee73f41cf797df4d910a6ab9b9e93 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 5 Nov 2021 09:10:38 +0300 Subject: [PATCH] Replace pragma with `add/remove => throw` --- .../NonVisual/FirstAvailableHitWindowsTest.cs | 15 +++++++++++---- .../Visual/Gameplay/TestSceneHitErrorMeter.cs | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/NonVisual/FirstAvailableHitWindowsTest.cs b/osu.Game.Tests/NonVisual/FirstAvailableHitWindowsTest.cs index 8d83fe7452..8386a10ebb 100644 --- a/osu.Game.Tests/NonVisual/FirstAvailableHitWindowsTest.cs +++ b/osu.Game.Tests/NonVisual/FirstAvailableHitWindowsTest.cs @@ -79,10 +79,17 @@ namespace osu.Game.Tests.NonVisual public List HitObjects; public override IEnumerable Objects => HitObjects; -#pragma warning disable 67 - public override event Action NewResult; - public override event Action RevertResult; -#pragma warning restore 67 + public override event Action NewResult + { + add => throw new InvalidOperationException(); + remove => throw new InvalidOperationException(); + } + + public override event Action RevertResult + { + add => throw new InvalidOperationException(); + remove => throw new InvalidOperationException(); + } public override Playfield Playfield { get; } public override Container Overlays { get; } diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneHitErrorMeter.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneHitErrorMeter.cs index aa29f1386c..c1260f0231 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneHitErrorMeter.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneHitErrorMeter.cs @@ -235,10 +235,17 @@ namespace osu.Game.Tests.Visual.Gameplay public override IEnumerable Objects => new[] { new HitCircle { HitWindows = HitWindows } }; -#pragma warning disable 67 - public override event Action NewResult; - public override event Action RevertResult; -#pragma warning restore 67 + public override event Action NewResult + { + add => throw new InvalidOperationException(); + remove => throw new InvalidOperationException(); + } + + public override event Action RevertResult + { + add => throw new InvalidOperationException(); + remove => throw new InvalidOperationException(); + } public override Playfield Playfield { get; } public override Container Overlays { get; }