aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Tests.Unicorn/IndexedProperty.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Tests.Unicorn/IndexedProperty.cs')
-rw-r--r--src/Ryujinx.Tests.Unicorn/IndexedProperty.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Ryujinx.Tests.Unicorn/IndexedProperty.cs b/src/Ryujinx.Tests.Unicorn/IndexedProperty.cs
new file mode 100644
index 00000000..65d445fc
--- /dev/null
+++ b/src/Ryujinx.Tests.Unicorn/IndexedProperty.cs
@@ -0,0 +1,28 @@
+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);
+ }
+ }
+ }
+}