using System.Collections; using System.Collections.Generic; namespace UnityEditor.ShaderGraph.Serialization { struct DataValueEnumerable : IEnumerable where T : JsonObject { List> m_List; public DataValueEnumerable(List> list) { m_List = list; } public void Sort(System.Comparison comparison) { m_List?.Sort((a, b) => comparison(a.value, b.value)); } public Enumerator GetEnumerator() => new Enumerator(m_List.GetEnumerator()); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); public struct Enumerator : IEnumerator { List>.Enumerator m_Enumerator; public Enumerator(List>.Enumerator enumerator) { m_Enumerator = enumerator; } public bool MoveNext() => m_Enumerator.MoveNext(); void IEnumerator.Reset() => ((IEnumerator)m_Enumerator).Reset(); public T Current => m_Enumerator.Current.value; object IEnumerator.Current => Current; public void Dispose() => m_Enumerator.Dispose(); } } }