Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ConcatKey.cs
Go to the documentation of this file.
3
5
6internal struct ConcatKey<TLeftKey, TRightKey>
7{
8 private sealed class ConcatKeyComparer : IComparer<ConcatKey<TLeftKey, TRightKey>>
9 {
11
13
19
21 {
22 if (x._isLeft != y._isLeft)
23 {
24 if (!x._isLeft)
25 {
26 return 1;
27 }
28 return -1;
29 }
30 if (x._isLeft)
31 {
32 return _leftComparer.Compare(x._leftKey, y._leftKey);
33 }
34 return _rightComparer.Compare(x._rightKey, y._rightKey);
35 }
36 }
37
38 private readonly TLeftKey _leftKey;
39
40 private readonly TRightKey _rightKey;
41
42 private readonly bool _isLeft;
43
45 {
49 }
50
52 {
53 return new ConcatKey<TLeftKey, TRightKey>(leftKey, default(TRightKey), isLeft: true);
54 }
55
57 {
58 return new ConcatKey<TLeftKey, TRightKey>(default(TLeftKey), rightKey, isLeft: false);
59 }
60
65}
readonly IComparer< TRightKey > _rightComparer
Definition ConcatKey.cs:12
int Compare(ConcatKey< TLeftKey, TRightKey > x, ConcatKey< TLeftKey, TRightKey > y)
Definition ConcatKey.cs:20
readonly IComparer< TLeftKey > _leftComparer
Definition ConcatKey.cs:10
ConcatKeyComparer(IComparer< TLeftKey > leftComparer, IComparer< TRightKey > rightComparer)
Definition ConcatKey.cs:14
static IComparer< ConcatKey< TLeftKey, TRightKey > > MakeComparer(IComparer< TLeftKey > leftComparer, IComparer< TRightKey > rightComparer)
Definition ConcatKey.cs:61
static ConcatKey< TLeftKey, TRightKey > MakeRight([AllowNull] TRightKey rightKey)
Definition ConcatKey.cs:56
readonly TRightKey _rightKey
Definition ConcatKey.cs:40
readonly TLeftKey _leftKey
Definition ConcatKey.cs:38
static ConcatKey< TLeftKey, TRightKey > MakeLeft([AllowNull] TLeftKey leftKey)
Definition ConcatKey.cs:51
ConcatKey([AllowNull] TLeftKey leftKey, [AllowNull] TRightKey rightKey, bool isLeft)
Definition ConcatKey.cs:44