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

Method CanCast

Source/Engine/Scripting/ScriptingObject.cpp:434–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434bool ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
435{
436 if (from == to)
437 return true;
438 if (!from && !to)
439 return true;
440 CHECK_RETURN(from && to, false);
441#if SCRIPTING_OBJECT_CAST_WITH_CSHARP
442 return CanCast(from.GetType().ManagedClass, to.GetType().ManagedClass);
443#else
444 return to.IsAssignableFrom(from);
445#endif
446}
447
448bool ScriptingObject::CanCast(const MClass* from, const MClass* to)
449{

Callers

nothing calls this directly

Calls 3

GetTypeMethod · 0.45
IsAssignableFromMethod · 0.45
IsSubClassOfMethod · 0.45

Tested by

no test coverage detected