CrabUI
Loading...
Searching...
No Matches
Indexer.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Reflection;
5using System.Diagnostics;
6using System.Runtime.CompilerServices;
7using System.IO;
8
9using Barotrauma;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Input;
12using Microsoft.Xna.Framework.Graphics;
13
14using System.Xml;
15using System.Xml.Linq;
16
17namespace CrabUI
18{
19 //xd
20 public class Indexer<TKey, TValue>
21 {
22 public Func<TKey, TValue> Get;
23 public Action<TKey, TValue> Set;
24
25 public TValue this[TKey key]
26 {
27 get => Get(key);
28 set => Set(key, value);
29 }
30
31 public Indexer(Func<TKey, TValue> get, Action<TKey, TValue> set) => (Get, Set) = (get, set);
32 }
33}