Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ BaseGroupSwitch()

void System.Data.ConstraintCollection.BaseGroupSwitch ( Constraint[] oldArray,
int oldLength,
Constraint[] newArray,
int newLength )
inlineprivate

Definition at line 263 of file ConstraintCollection.cs.

264 {
265 int num = 0;
266 for (int i = 0; i < oldLength; i++)
267 {
268 bool flag = false;
269 for (int j = num; j < newLength; j++)
270 {
271 if (oldArray[i] == newArray[j])
272 {
273 if (num == j)
274 {
275 num++;
276 }
277 flag = true;
278 break;
279 }
280 }
281 if (!flag)
282 {
283 BaseRemove(oldArray[i]);
284 List.Remove(oldArray[i]);
285 }
286 }
287 for (int k = 0; k < newLength; k++)
288 {
289 if (!newArray[k].InCollection)
290 {
291 BaseAdd(newArray[k]);
292 }
293 List.Add(newArray[k]);
294 }
295 }
virtual void Remove(object? obj)
virtual int Add(object? value)
void BaseAdd(Constraint constraint)
void BaseRemove(Constraint constraint)

References System.Collections.ArrayList.Add(), System.Data.ConstraintCollection.BaseAdd(), System.Data.ConstraintCollection.BaseRemove(), System.Data.ConstraintCollection.List, and System.Collections.ArrayList.Remove().

Referenced by System.Data.ConstraintCollection.Clear().