A game about forced loneliness, made by TACStudios
at master 542 B view raw
1using System.Collections.Generic; 2 3namespace Unity.PlasticSCM.Editor.UI 4{ 5 internal class SortOrderComparer<T> : IComparer<T> 6 { 7 internal SortOrderComparer(IComparer<T> comparer, bool isAscending) 8 { 9 mComparer = comparer; 10 mIsAscending = isAscending; 11 } 12 13 int IComparer<T>.Compare(T x, T y) 14 { 15 int result = mComparer.Compare(x, y); 16 return mIsAscending ? result : -result; 17 } 18 19 bool mIsAscending; 20 IComparer<T> mComparer; 21 } 22}