2018-09-01 16:24:05 +02: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 04:39:22 +02:00
|
|
|
GetFunc = getFunc;
|
|
|
|
SetAction = setAction;
|
2018-09-01 16:24:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public TValue this[TIndex i]
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return GetFunc(i);
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
SetAction(i, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|