Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DocumentOrderComparer.cs
Go to the documentation of this file.
3
5
6internal sealed class DocumentOrderComparer : IComparer<XPathNavigator>
7{
9
11 {
12 switch (navThis.ComparePosition(navThat))
13 {
14 case XmlNodeOrder.Before:
15 return -1;
16 case XmlNodeOrder.Same:
17 return 0;
18 case XmlNodeOrder.After:
19 return 1;
20 default:
21 if (_roots == null)
22 {
24 }
26 {
27 return 1;
28 }
29 return -1;
30 }
31 }
32
34 {
35 if (_roots == null)
36 {
38 }
40 xPathNavigator.MoveToRoot();
41 for (int i = 0; i < _roots.Count; i++)
42 {
43 if (xPathNavigator.IsSamePosition(_roots[i]))
44 {
45 return i;
46 }
47 }
49 return _roots.Count - 1;
50 }
51}
int Compare(XPathNavigator navThis, XPathNavigator navThat)