Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
QilList.cs
Go to the documentation of this file.
1namespace System.Xml.Xsl.Qil;
2
3internal sealed class QilList : QilNode
4{
5 private int _count;
6
7 private QilNode[] _members;
8
9 public override XmlQueryType XmlType
10 {
11 get
12 {
13 if (xmlType == null)
14 {
16 if (_count > 0)
17 {
18 if (nodeType == QilNodeType.Sequence)
19 {
20 for (int i = 0; i < _count; i++)
21 {
23 }
24 }
25 else if (nodeType == QilNodeType.BranchList)
26 {
27 left = _members[0].XmlType;
28 for (int j = 1; j < _count; j++)
29 {
31 }
32 }
33 }
34 xmlType = left;
35 }
36 return xmlType;
37 }
38 }
39
40 public override int Count => _count;
41
42 public override QilNode this[int index]
43 {
44 get
45 {
46 if (index >= 0 && index < _count)
47 {
48 return _members[index];
49 }
50 throw new IndexOutOfRangeException();
51 }
52 set
53 {
54 if (index >= 0 && index < _count)
55 {
57 xmlType = null;
58 return;
59 }
60 throw new IndexOutOfRangeException();
61 }
62 }
63
65 : base(nodeType)
66 {
67 _members = new QilNode[4];
68 xmlType = null;
69 }
70
71 public override QilNode ShallowClone(QilFactory f)
72 {
73 QilList qilList = (QilList)MemberwiseClone();
75 return qilList;
76 }
77
78 public override void Insert(int index, QilNode node)
79 {
81 {
82 throw new IndexOutOfRangeException();
83 }
84 if (_count == _members.Length)
85 {
86 QilNode[] array = new QilNode[_count * 2];
89 }
90 if (index < _count)
91 {
93 }
94 _count++;
96 xmlType = null;
97 }
98
99 public override void RemoveAt(int index)
100 {
102 {
103 throw new IndexOutOfRangeException();
104 }
105 _count--;
106 if (index < _count)
107 {
109 }
110 _members[_count] = null;
111 xmlType = null;
112 }
113}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
override XmlQueryType XmlType
Definition QilList.cs:10
override QilNode ShallowClone(QilFactory f)
Definition QilList.cs:71
override void Insert(int index, QilNode node)
Definition QilList.cs:78
override void RemoveAt(int index)
Definition QilList.cs:99
QilList(QilNodeType nodeType)
Definition QilList.cs:64
virtual XmlQueryType XmlType
Definition QilNode.cs:29
static XmlQueryType Choice(XmlQueryType left, XmlQueryType right)
static XmlQueryType Sequence(XmlQueryType left, XmlQueryType right)
static readonly XmlQueryType Empty