Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PairComparer.cs
Go to the documentation of this file.
2
4
5internal sealed class PairComparer<T, U> : IComparer<Pair<T, U>>
6{
7 private readonly IComparer<T> _comparer1;
8
9 private readonly IComparer<U> _comparer2;
10
16
17 public int Compare(Pair<T, U> x, Pair<T, U> y)
18 {
19 int num = _comparer1.Compare(x.First, y.First);
20 if (num != 0)
21 {
22 return num;
23 }
24 if (_comparer2 == null)
25 {
26 return num;
27 }
28 return _comparer2.Compare(x.Second, y.Second);
29 }
30}
readonly IComparer< T > _comparer1
readonly IComparer< U > _comparer2
PairComparer(IComparer< T > comparer1, IComparer< U > comparer2)
int Compare(Pair< T, U > x, Pair< T, U > y)