From 3ed5a463d15db737b72a7ebda5bfb8117153a07d Mon Sep 17 00:00:00 2001 From: Pavel Minaev Date: Fri, 30 Nov 2018 20:41:21 -0800 Subject: [PATCH] Add a string indexer to Slots, to shadow the inherited one from Collection. --- WarBender/Slots.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WarBender/Slots.cs b/WarBender/Slots.cs index 458c0eb..1404ac1 100644 --- a/WarBender/Slots.cs +++ b/WarBender/Slots.cs @@ -72,6 +72,11 @@ protected override void OnItemAdded(long item, int index) { Raw[index] = RawValue(value); } + public new object this[string key] { + get => this[GetIndexOfKey(key)]; + set => this[GetIndexOfKey(key)] = value; + } + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); public new IEnumerator GetEnumerator() {