misc: chore: [ci skip] rename ValueFormatter to SingleValueFormatter and some minor cleanups

This commit is contained in:
Evan Husted
2025-02-08 01:34:44 -06:00
parent 30a534edcd
commit 9c226dcc7a
4 changed files with 45 additions and 46 deletions

View File

@@ -7,7 +7,7 @@ namespace Ryujinx.Ava.Utilities.PlayReport
{
public abstract class MatchedValue<T>
{
public MatchedValue(T matched)
protected MatchedValue(T matched)
{
Matched = matched;
}
@@ -29,7 +29,7 @@ namespace Ryujinx.Ava.Utilities.PlayReport
}
/// <summary>
/// The input data to a <see cref="ValueFormatter"/>,
/// The input data to a <see cref="SingleValueFormatter"/>,
/// containing the currently running application's <see cref="ApplicationMetadata"/>,
/// and the matched <see cref="MessagePackObject"/> from the Play Report.
/// </summary>
@@ -38,8 +38,6 @@ namespace Ryujinx.Ava.Utilities.PlayReport
public SingleValue(Value matched) : base(matched)
{
}
public static implicit operator SingleValue(MessagePackObject mpo) => new(mpo);
}
/// <summary>
@@ -56,9 +54,6 @@ namespace Ryujinx.Ava.Utilities.PlayReport
public MultiValue(IEnumerable<MessagePackObject> matched) : base(Value.ConvertPackedObjects(matched))
{
}
public static implicit operator MultiValue(List<MessagePackObject> matched)
=> new(matched.Select(x => new Value(x)).ToArray());
}
/// <summary>
@@ -75,13 +70,5 @@ namespace Ryujinx.Ava.Utilities.PlayReport
public SparseMultiValue(Dictionary<string, MessagePackObject> matched) : base(Value.ConvertPackedObjectMap(matched))
{
}
public static implicit operator SparseMultiValue(Dictionary<string, MessagePackObject> matched)
=> new(matched
.ToDictionary(
x => x.Key,
x => new Value(x.Value)
)
);
}
}