Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DeclarationBinding.cs
Go to the documentation of this file.
1using System;
3
5
6internal class DeclarationBinding
7{
8 internal class BindingNode
9 {
11
12 internal unsafe IDirect3DVertexDeclaration9* pDecl;
13
15
17 {
19 if (list != null)
20 {
21 int num = 0;
22 if (0 < list.Count)
23 {
24 do
25 {
27 if (keyValuePair.Key != key)
28 {
29 num++;
30 continue;
31 }
32 return keyValuePair.Value;
33 }
34 while (num < children.Count);
35 }
36 }
37 return null;
38 }
39
49
50 internal unsafe void RemoveChild(DeclarationBinding key)
51 {
53 if (list == null)
54 {
55 return;
56 }
57 int num = 0;
58 if (0 >= list.Count)
59 {
60 return;
61 }
63 while (true)
64 {
66 if (keyValuePair.Key == key)
67 {
68 break;
69 }
70 num++;
71 if (num >= children.Count)
72 {
73 return;
74 }
75 }
76 children.RemoveAt(num);
79 if (ptr != null)
80 {
81 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint>)(int)(*(uint*)(*(int*)ptr + 8)))((nint)ptr);
82 value.pDecl = null;
83 }
85 if (ptr2 != null)
86 {
87 _003CModule_003E.delete(ptr2);
88 value.pSemantics = null;
89 }
91 if (list2 == null)
92 {
93 return;
94 }
96 if (enumerator.MoveNext())
97 {
98 do
99 {
101 current.Key.indirectOffspring.Remove(value);
102 current.Value.RecursiveRelease();
103 }
104 while (enumerator.MoveNext());
105 }
106 value.children = null;
107 }
108
109 internal unsafe void RecursiveRelease()
110 {
112 if (ptr != null)
113 {
114 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint>)(int)(*(uint*)(*(int*)ptr + 8)))((nint)ptr);
115 pDecl = null;
116 }
118 if (ptr2 != null)
119 {
120 _003CModule_003E.delete(ptr2);
121 pSemantics = null;
122 }
124 if (list == null)
125 {
126 return;
127 }
129 if (enumerator.MoveNext())
130 {
131 do
132 {
134 current.Key.indirectOffspring.Remove(this);
135 current.Value.RecursiveRelease();
136 }
137 while (enumerator.MoveNext());
138 }
139 children = null;
140 }
141 }
142
144
145 internal int referenceCount;
146
148
150
152 {
153 this.elements = elements;
154 referenceCount = 1;
155 base._002Ector();
156 root = new BindingNode();
158 }
159}
List< KeyValuePair< DeclarationBinding, BindingNode > > children
void AddChild(DeclarationBinding key, BindingNode value)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)