IndexedProperty.cs
1 using System; 2 3 namespace Ryujinx.Tests.Unicorn 4 { 5 public class IndexedProperty<TIndex, TValue> 6 { 7 private readonly Func<TIndex, TValue> _getFunc; 8 private readonly Action<TIndex, TValue> _setAction; 9 10 public IndexedProperty(Func<TIndex, TValue> getFunc, Action<TIndex, TValue> setAction) 11 { 12 _getFunc = getFunc; 13 _setAction = setAction; 14 } 15 16 public TValue this[TIndex index] 17 { 18 get 19 { 20 return _getFunc(index); 21 } 22 set 23 { 24 _setAction(index, value); 25 } 26 } 27 } 28 }