Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlDoubleSortKey.cs
Go to the documentation of this file.
2
3internal sealed class XmlDoubleSortKey : XmlSortKey
4{
5 private readonly double _dblVal;
6
7 private readonly bool _isNaN;
8
10 {
11 if (double.IsNaN(value))
12 {
13 _isNaN = true;
14 _dblVal = ((collation.EmptyGreatest != collation.DescendingOrder) ? double.PositiveInfinity : double.NegativeInfinity);
15 }
16 else
17 {
19 }
20 }
21
22 public override int CompareTo(object obj)
23 {
25 {
26 if (_isNaN)
27 {
29 }
30 return CompareToEmpty(obj);
31 }
32 if (_dblVal == xmlDoubleSortKey._dblVal)
33 {
34 if (_isNaN)
35 {
36 if (xmlDoubleSortKey._isNaN)
37 {
39 }
40 if (_dblVal != double.NegativeInfinity)
41 {
42 return 1;
43 }
44 return -1;
45 }
46 if (xmlDoubleSortKey._isNaN)
47 {
48 if (xmlDoubleSortKey._dblVal != double.NegativeInfinity)
49 {
50 return -1;
51 }
52 return 1;
53 }
55 }
56 if (!(_dblVal < xmlDoubleSortKey._dblVal))
57 {
58 return 1;
59 }
60 return -1;
61 }
62}
XmlDoubleSortKey(double value, XmlCollation collation)
int BreakSortingTie(XmlSortKey that)
Definition XmlSortKey.cs:33