using System.Collections; namespace Qrakhen.Qamp.Core.Collections; public class FixedArray : IEnumerable, IGetSet { protected T[] Data; public long Length => Data.LongLength; public T this[long index] { get => Get(index); set => Set(index, value); } public FixedArray(IEnumerable data) { Data = data.ToArray(); } public T Get(long index) => Data[index]; public void Set(long index, T value) { Data[index] = value; } public IEnumerator GetEnumerator() { foreach (var item in Data) yield return item; } IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); }