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

◆ OnDeserialization()

virtual void System.Collections.Generic.HashSet< T >.OnDeserialization ( object? sender)
inlinevirtual

Implements System.Runtime.Serialization.IDeserializationCallback.

Definition at line 403 of file HashSet.cs.

404 {
405 HashHelpers.SerializationInfoTable.TryGetValue(this, out var value);
406 if (value == null)
407 {
408 return;
409 }
410 int @int = value.GetInt32("Capacity");
411 _comparer = (IEqualityComparer<T>)value.GetValue("Comparer", typeof(IEqualityComparer<T>));
412 _freeList = -1;
413 _freeCount = 0;
414 if (@int != 0)
415 {
416 _buckets = new int[@int];
417 _entries = new Entry[@int];
418 _fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)@int);
419 T[] array = (T[])value.GetValue("Elements", typeof(T[]));
420 if (array == null)
421 {
422 ThrowHelper.ThrowSerializationException(ExceptionResource.Serialization_MissingKeys);
423 }
424 for (int i = 0; i < array.Length; i++)
425 {
427 }
428 }
429 else
430 {
431 _buckets = null;
432 }
433 _version = value.GetInt32("Version");
434 HashHelpers.SerializationInfoTable.Remove(this);
435 }
IEqualityComparer< T > _comparer
Definition HashSet.cs:105
bool AddIfNotPresent(T value, out int location)
Definition HashSet.cs:892

References System.Collections.Generic.HashSet< T >._buckets, System.Collections.Generic.HashSet< T >._comparer, System.Collections.Generic.HashSet< T >._entries, System.Collections.Generic.HashSet< T >._fastModMultiplier, System.Collections.Generic.HashSet< T >._freeCount, System.Collections.Generic.HashSet< T >._freeList, System.Collections.Generic.HashSet< T >._version, System.Collections.Generic.HashSet< T >.AddIfNotPresent(), System.array, System.Collections.HashHelpers.GetFastModMultiplier(), System.Collections.HashHelpers.SerializationInfoTable, System.ThrowHelper.ThrowSerializationException(), and System.value.