2018-09-01 14:24:05 +00:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Ryujinx.Tests.Unicorn
|
|
|
|
{
|
|
|
|
public class IndexedProperty<TIndex, TValue>
|
|
|
|
{
|
|
|
|
readonly Action<TIndex, TValue> SetAction;
|
|
|
|
readonly Func<TIndex, TValue> GetFunc;
|
|
|
|
|
|
|
|
public IndexedProperty(Func<TIndex, TValue> getFunc, Action<TIndex, TValue> setAction)
|
|
|
|
{
|
2019-07-02 02:39:22 +00:00
|
|
|
GetFunc = getFunc;
|
|
|
|
SetAction = setAction;
|
2018-09-01 14:24:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public TValue this[TIndex i]
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return GetFunc(i);
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
SetAction(i, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|