MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Cast

Function Cast

Source/Engine/Scripting/ScriptingObject.h:159–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157
158 template<typename T>
159 static T* Cast(ScriptingObject* obj)
160 {
161#if SCRIPTING_OBJECT_CAST_WITH_CSHARP
162 return obj && CanCast(obj->GetClass(), T::GetStaticClass()) ? static_cast<T*>(obj) : nullptr;
163#else
164 return obj && CanCast(obj->GetTypeHandle(), T::TypeInitializer) ? static_cast<T*>(obj) : nullptr;
165#endif
166 }
167
168 bool Is(const ScriptingTypeHandle& type) const;
169

Callers

nothing calls this directly

Calls 1

GetClassMethod · 0.45

Tested by

no test coverage detected