misc: chore: .Match helper method on PlayReportAnalyzer.FormattedValue.
This commit is contained in:
parent
f225b18c05
commit
65f08caaa3
@ -115,7 +115,7 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A potential formatted value returned by a <see cref="PlayReportValueFormatter"/>.
|
/// A potential formatted value returned by a <see cref="PlayReportValueFormatter"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct FormattedValue
|
public readonly struct FormattedValue
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Was any handler able to match anything in the Play Report?
|
/// Was any handler able to match anything in the Play Report?
|
||||||
@ -132,6 +132,23 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string FormattedString { get; private init; }
|
public string FormattedString { get; private init; }
|
||||||
|
|
||||||
|
public void Match(out bool wasHandled, Action onReset, Action<string> onSuccess)
|
||||||
|
{
|
||||||
|
if (!Handled)
|
||||||
|
{
|
||||||
|
wasHandled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Reset)
|
||||||
|
onReset();
|
||||||
|
else
|
||||||
|
onSuccess(FormattedString);
|
||||||
|
|
||||||
|
wasHandled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The intended path of execution for having a string to return: simply return the string.
|
/// The intended path of execution for having a string to return: simply return the string.
|
||||||
/// This implicit conversion will make the struct for you.<br/><br/>
|
/// This implicit conversion will make the struct for you.<br/><br/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user