Ryujinx/src/Ryujinx.Tests.Unicorn/IndexedProperty.cs
2023-04-27 23:51:14 +02:00

28 lines
630 B
C#

using System;
namespace Ryujinx.Tests.Unicorn
{
public class IndexedProperty<TIndex, TValue>
{
private Func<TIndex, TValue> _getFunc;
private 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);
}
}
}
}