diff --git a/Engine.Core/Helpers/FastList.cs b/Engine.Core/Helpers/FastList.cs index fa64216..89b11b3 100644 --- a/Engine.Core/Helpers/FastList.cs +++ b/Engine.Core/Helpers/FastList.cs @@ -3,14 +3,15 @@ using System.Collections.Generic; namespace Engine.Core; -public class FastList : IReadOnlyList, IEnumerable where T : notnull +public class FastList : IList, IReadOnlyList, IEnumerable where T : notnull { private readonly List items = []; private readonly Dictionary indexMap = []; public int Count => items.Count; - public T this[int index] => items[index]; + public bool IsReadOnly { get; set; } = false; + public T this[int index] { get => items[index]; set => items[index] = value; } public void Add(T item) { @@ -66,6 +67,9 @@ public class FastList : IReadOnlyList, IEnumerable where T : notnull indexMap[items[i]] = i; } + public int IndexOf(T item) => items.IndexOf(item); + public void CopyTo(T[] array, int arrayIndex) => items.CopyTo(array, arrayIndex); + public IEnumerator GetEnumerator() => items.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();