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

◆ RemoveAnnotations< T >()

Type Constraints
T :class 

Definition at line 355 of file XObject.cs.

355 : class
356 {
357 if (annotations == null)
358 {
359 return;
360 }
361 if (!(annotations is object[] array))
362 {
363 if (annotations is T)
364 {
365 annotations = null;
366 }
367 return;
368 }
369 int i = 0;
370 int num = 0;
371 for (; i < array.Length; i++)
372 {
373 object obj = array[i];
374 if (obj == null)
375 {
376 break;
377 }
378 if (!(obj is T))
379 {
380 array[num++] = obj;
381 }
382 }
383 if (num == 0)
384 {
385 annotations = null;
386 return;
387 }
388 while (num < i)
389 {
390 array[num++] = null;
391 }
392 }

References System.Xml.Linq.XObject.annotations, System.array, and System.obj.