Ryujinx/src/Ryujinx.Tests.Unicorn/IndexedProperty.cs
TSRBerry bddb2a1483
[Ryujinx.Tests.Unicorn] Address dotnet-format issues (#5391)
* dotnet format style --severity info

Some changes were manually reverted.

* Restore a few unused methods and variables

* Address most dotnet format whitespace warnings

* Apply dotnet format whitespace formatting

A few of them have been manually reverted and the corresponding warning was silenced

* Add comments to disabled warnings

* Simplify properties and array initialization, Use const when possible, Remove trailing commas

* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"

This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.

* dotnet format whitespace after rebase

* Final dotnet format pass and fix naming rule violations
2023-06-25 18:03:08 +02:00

29 lines
644 B
C#

using System;
namespace Ryujinx.Tests.Unicorn
{
public class IndexedProperty<TIndex, TValue>
{
private readonly Func<TIndex, TValue> _getFunc;
private readonly Action<TIndex, TValue> _setAction;
public IndexedProperty(Func<TIndex, TValue> getFunc, Action<TIndex, TValue> setAction)
{
_getFunc = getFunc;
_setAction = setAction;
}
public TValue this[TIndex index]
{
get
{
return _getFunc(index);
}
set
{
_setAction(index, value);
}
}
}
}