From 65f08caaa36077549ed122597e118679b85b495d Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 3 Feb 2025 19:18:17 -0600 Subject: [PATCH] misc: chore: .Match helper method on PlayReportAnalyzer.FormattedValue. --- src/Ryujinx/Utilities/PlayReportAnalyzer.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx/Utilities/PlayReportAnalyzer.cs b/src/Ryujinx/Utilities/PlayReportAnalyzer.cs index e2a520907..8ec57fdde 100644 --- a/src/Ryujinx/Utilities/PlayReportAnalyzer.cs +++ b/src/Ryujinx/Utilities/PlayReportAnalyzer.cs @@ -115,7 +115,7 @@ namespace Ryujinx.Ava.Utilities /// /// A potential formatted value returned by a . /// - public struct FormattedValue + public readonly struct FormattedValue { /// /// Was any handler able to match anything in the Play Report? @@ -132,6 +132,23 @@ namespace Ryujinx.Ava.Utilities /// public string FormattedString { get; private init; } + public void Match(out bool wasHandled, Action onReset, Action onSuccess) + { + if (!Handled) + { + wasHandled = false; + return; + } + + if (Reset) + onReset(); + else + onSuccess(FormattedString); + + wasHandled = true; + } + + /// /// The intended path of execution for having a string to return: simply return the string. /// This implicit conversion will make the struct for you.