Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Comparer.cs
Go to the documentation of this file.
1
using
System.Runtime.CompilerServices
;
2
3
namespace
System.Collections.Generic
;
4
5
[
Serializable
]
6
[TypeDependency(
"System.Collections.Generic.ObjectComparer`1"
)]
7
[TypeForwardedFrom(
"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
)]
8
public
abstract
class
Comparer
<T> :
IComparer
,
IComparer
<T>
9
{
10
public
static
Comparer<T>
Default
11
{
12
[
Intrinsic
]
13
get
;
14
} = (
Comparer<T>
)
ComparerHelpers
.
CreateDefaultComparer
(
typeof
(T));
15
16
17
public
static
Comparer<T>
Create
(
Comparison<T>
comparison
)
18
{
19
if
(
comparison
==
null
)
20
{
21
throw
new
ArgumentNullException
(
"comparison"
);
22
}
23
return
new
ComparisonComparer<T>
(
comparison
);
24
}
25
26
public
abstract
int
Compare
(T? x, T? y);
27
28
int
IComparer
.
Compare
(
object
x,
object
y)
29
{
30
if
(x ==
null
)
31
{
32
if
(y !=
null
)
33
{
34
return
-1;
35
}
36
return
0;
37
}
38
if
(y ==
null
)
39
{
40
return
1;
41
}
42
if
(x
is
T && y
is
T)
43
{
44
return
Compare
((T)x, (T)y);
45
}
46
ThrowHelper
.
ThrowArgumentException
(
ExceptionResource
.Argument_InvalidArgumentForComparison);
47
return
0;
48
}
49
}
System.ArgumentNullException
Definition
ArgumentNullException.cs:10
System.Collections.Generic.ComparerHelpers.CreateDefaultComparer
static object CreateDefaultComparer(Type type)
Definition
ComparerHelpers.cs:5
System.Collections.Generic.ComparerHelpers
Definition
ComparerHelpers.cs:4
System.Collections.Generic.Comparer.Create
static Comparer< T > Create(Comparison< T > comparison)
Definition
Comparer.cs:17
System.Collections.Generic.Comparer.Compare
int Compare(T? x, T? y)
System.Collections.Generic.Comparer.Default
static Comparer< T > Default
Definition
Comparer.cs:11
System.Collections.Generic.Comparer
Definition
Comparer.cs:9
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.ThrowHelper.ThrowArgumentException
static void ThrowArgumentException(ExceptionResource resource)
Definition
ThrowHelper.cs:169
System.ThrowHelper
Definition
ThrowHelper.cs:6
System.Collections.Generic.IComparer.Compare
int Compare(T? x, T? y)
System.Collections.Generic.IComparer
Definition
IComparer.cs:4
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Data.IsolationLevel.Serializable
@ Serializable
System.Runtime.CompilerServices
Definition
NullablePublicOnlyAttribute.cs:3
System.ExceptionResource
ExceptionResource
Definition
ExceptionResource.cs:4
System.ExceptionArgument.comparison
@ comparison
source
System.Private.CoreLib
System.Collections.Generic
Comparer.cs
Generated by
1.10.0