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

◆ IsInstanceOfAny()

static unsafe object System.Runtime.CompilerServices.CastHelpers.IsInstanceOfAny ( void * toTypeHnd,
object obj )
inlinestaticprivate

Definition at line 118 of file CastHelpers.cs.

119 {
120 if (obj != null)
121 {
122 void* methodTable = RuntimeHelpers.GetMethodTable(obj);
123 if (methodTable != toTypeHnd)
124 {
125 CastResult castResult = TryGet((nuint)methodTable, (nuint)toTypeHnd);
126 if (castResult != CastResult.CanCast)
127 {
128 if (castResult != 0)
129 {
130 return IsInstanceOfAny_NoCacheLookup(toTypeHnd, obj);
131 }
132 obj = null;
133 }
134 }
135 }
136 return obj;
137 }
static unsafe object IsInstanceOfAny_NoCacheLookup(void *toTypeHnd, object obj)
static CastResult TryGet(nuint source, nuint target)

References System.Runtime.CompilerServices.RuntimeHelpers.GetMethodTable(), System.Runtime.CompilerServices.CastHelpers.IsInstanceOfAny_NoCacheLookup(), System.obj, and System.Runtime.CompilerServices.CastHelpers.TryGet().