Terraria
v1.4.4.9
Terraria source code documentation
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Events
_
a
c
d
e
f
i
l
m
o
p
r
s
t
u
w
Files
File List
File Members
All
Enumerations
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Properties
Events
Macros
Loading...
Searching...
No Matches
XPathMultyIterator.cs
Go to the documentation of this file.
1
using
System
;
2
using
System.Collections
;
3
using
System.Xml
;
4
using
System.Xml.XPath
;
5
6
namespace
MS.Internal.Xml.XPath
;
7
8
internal
sealed
class
XPathMultyIterator
:
ResetableIterator
9
{
10
private
ResetableIterator
[]
arr
;
11
12
private
int
firstNotEmpty
;
13
14
private
int
position
;
15
16
public
override
XPathNavigator
Current
=>
arr
[
firstNotEmpty
].
Current
;
17
18
public
override
int
CurrentPosition
=>
position
;
19
20
public
XPathMultyIterator
(
ArrayList
inputArray
)
21
{
22
arr
=
new
ResetableIterator
[
inputArray
.Count];
23
for
(
int
i = 0; i <
arr
.Length; i++)
24
{
25
ArrayList
list
= (
ArrayList
)
inputArray
[i];
26
arr
[i] =
new
XPathArrayIterator
(
list
);
27
}
28
Init
();
29
}
20
public
XPathMultyIterator
(
ArrayList
inputArray
) {
…
}
30
31
private
void
Init
()
32
{
33
for
(
int
i = 0; i <
arr
.Length; i++)
34
{
35
Advance
(i);
36
}
37
int
num =
arr.Length
- 2;
38
while
(
firstNotEmpty
<= num)
39
{
40
if
(
SiftItem
(num))
41
{
42
num--;
43
}
44
}
45
}
31
private
void
Init
() {
…
}
46
47
private
bool
Advance
(
int
pos)
48
{
49
if
(!
arr
[pos].
MoveNext
())
50
{
51
if
(
firstNotEmpty
!= pos)
52
{
53
ResetableIterator
resetableIterator
=
arr
[pos];
54
Array
.
Copy
(
arr
,
firstNotEmpty
,
arr
,
firstNotEmpty
+ 1, pos -
firstNotEmpty
);
55
arr
[
firstNotEmpty
] =
resetableIterator
;
56
}
57
firstNotEmpty
++;
58
return
false
;
59
}
60
return
true
;
61
}
47
private
bool
Advance
(
int
pos) {
…
}
62
63
private
bool
SiftItem
(
int
item
)
64
{
65
ResetableIterator
resetableIterator
=
arr
[
item
];
66
while
(
item
+ 1 <
arr
.Length)
67
{
68
ResetableIterator
resetableIterator2
=
arr
[
item
+ 1];
69
switch
(
Query
.
CompareNodes
(
resetableIterator
.Current,
resetableIterator2
.Current))
70
{
71
case
XmlNodeOrder
.After:
72
arr
[
item
] =
resetableIterator2
;
73
item
++;
74
continue
;
75
default
:
76
arr
[
item
] =
resetableIterator
;
77
if
(!
Advance
(
item
))
78
{
79
return
false
;
80
}
81
resetableIterator
=
arr
[
item
];
82
continue
;
83
case
XmlNodeOrder
.Before:
84
break
;
85
}
86
break
;
87
}
88
arr
[
item
] =
resetableIterator
;
89
return
true
;
90
}
63
private
bool
SiftItem
(
int
item
) {
…
}
91
92
public
override
void
Reset
()
93
{
94
firstNotEmpty
= 0;
95
position
= 0;
96
for
(
int
i = 0; i <
arr
.Length; i++)
97
{
98
arr
[i].
Reset
();
99
}
100
Init
();
101
}
92
public
override
void
Reset
() {
…
}
102
103
public
XPathMultyIterator
(
XPathMultyIterator
it
)
104
{
105
arr
= (
ResetableIterator
[])
it
.arr.
Clone
();
106
firstNotEmpty
=
it
.firstNotEmpty;
107
position
=
it
.position;
108
}
103
public
XPathMultyIterator
(
XPathMultyIterator
it
) {
…
}
109
110
public
override
XPathNodeIterator
Clone
()
111
{
112
return
new
XPathMultyIterator
(
this
);
113
}
110
public
override
XPathNodeIterator
Clone
() {
…
}
114
115
public
override
bool
MoveNext
()
116
{
117
if
(
firstNotEmpty
>=
arr
.Length)
118
{
119
return
false
;
120
}
121
if
(
position
!= 0)
122
{
123
if
(
Advance
(
firstNotEmpty
))
124
{
125
SiftItem
(
firstNotEmpty
);
126
}
127
if
(
firstNotEmpty
>=
arr
.Length)
128
{
129
return
false
;
130
}
131
}
132
position
++;
133
return
true
;
134
}
115
public
override
bool
MoveNext
() {
…
}
135
}
8
internal
sealed
class
XPathMultyIterator
:
ResetableIterator
{
…
};
MS.Internal.Xml.XPath.Query.CompareNodes
static XmlNodeOrder CompareNodes(XPathNavigator l, XPathNavigator r)
Definition
Query.cs:127
MS.Internal.Xml.XPath.Query
Definition
Query.cs:13
MS.Internal.Xml.XPath.ResetableIterator.Reset
void Reset()
MS.Internal.Xml.XPath.ResetableIterator
Definition
ResetableIterator.cs:6
MS.Internal.Xml.XPath.XPathArrayIterator
Definition
XPathArrayIterator.cs:10
MS.Internal.Xml.XPath.XPathMultyIterator.CurrentPosition
override int CurrentPosition
Definition
XPathMultyIterator.cs:18
MS.Internal.Xml.XPath.XPathMultyIterator.XPathMultyIterator
XPathMultyIterator(ArrayList inputArray)
Definition
XPathMultyIterator.cs:20
MS.Internal.Xml.XPath.XPathMultyIterator.Reset
override void Reset()
Definition
XPathMultyIterator.cs:92
MS.Internal.Xml.XPath.XPathMultyIterator.Clone
override XPathNodeIterator Clone()
Definition
XPathMultyIterator.cs:110
MS.Internal.Xml.XPath.XPathMultyIterator.firstNotEmpty
int firstNotEmpty
Definition
XPathMultyIterator.cs:12
MS.Internal.Xml.XPath.XPathMultyIterator.Advance
bool Advance(int pos)
Definition
XPathMultyIterator.cs:47
MS.Internal.Xml.XPath.XPathMultyIterator.Init
void Init()
Definition
XPathMultyIterator.cs:31
MS.Internal.Xml.XPath.XPathMultyIterator.MoveNext
override bool MoveNext()
Definition
XPathMultyIterator.cs:115
MS.Internal.Xml.XPath.XPathMultyIterator.arr
ResetableIterator[] arr
Definition
XPathMultyIterator.cs:10
MS.Internal.Xml.XPath.XPathMultyIterator.position
int position
Definition
XPathMultyIterator.cs:14
MS.Internal.Xml.XPath.XPathMultyIterator.SiftItem
bool SiftItem(int item)
Definition
XPathMultyIterator.cs:63
MS.Internal.Xml.XPath.XPathMultyIterator.Current
override XPathNavigator Current
Definition
XPathMultyIterator.cs:16
MS.Internal.Xml.XPath.XPathMultyIterator.XPathMultyIterator
XPathMultyIterator(XPathMultyIterator it)
Definition
XPathMultyIterator.cs:103
MS.Internal.Xml.XPath.XPathMultyIterator
Definition
XPathMultyIterator.cs:9
System.Array.Copy
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition
Array.cs:624
System.Array
Definition
Array.cs:16
System.Collections.ArrayList
Definition
ArrayList.cs:11
System.Xml.XPath.XPathNavigator
Definition
XPathNavigator.cs:15
System.Xml.XPath.XPathNodeIterator.Clone
object ICloneable. Clone()
Definition
XPathNodeIterator.cs:93
System.Xml.XPath.XPathNodeIterator.Current
XPathNavigator? Current
Definition
XPathNodeIterator.cs:61
System.Xml.XPath.XPathNodeIterator
Definition
XPathNodeIterator.cs:8
MS.Internal.Xml.XPath
Definition
AbsoluteQuery.cs:3
System.Collections
Definition
BlockingCollection.cs:8
System.Xml.XPath
Definition
Extensions.cs:5
System.Xml.XmlNodeOrder
XmlNodeOrder
Definition
XmlNodeOrder.cs:4
System.Xml.ValueHandleType.Dictionary
@ Dictionary
System.Xml
Definition
BaseRegionIterator.cs:1
System.ExceptionArgument.list
@ list
System.ExceptionArgument.item
@ item
System
Definition
BlockingCollection.cs:8
source
System.Private.Xml
MS.Internal.Xml.XPath
XPathMultyIterator.cs
Generated by
1.10.0