diff --git a/QSB/Utility/ListStack.cs b/QSB/Utility/ListStack.cs index 8a960bca..58ecd2f3 100644 --- a/QSB/Utility/ListStack.cs +++ b/QSB/Utility/ListStack.cs @@ -102,6 +102,18 @@ public class ListStack : IEnumerable public int RemoveAll(Predicate match) => _items.RemoveAll(match); + /// + /// Returns the index of the given item, where 0 is the back of the stack. + /// + public int IndexOf(T item) + => _items.IndexOf(item); + + public T this[int index] + { + get => _items[index]; + set => _items[index] = value; + } + IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)_items).GetEnumerator(); public IEnumerator GetEnumerator() => ((IEnumerable)_items).GetEnumerator(); }