| 20 | #include "Engine/Serialization/Serialization.h" |
| 21 | |
| 22 | bool IsAssignableFrom(const StringAnsiView& to, const StringAnsiView& from) |
| 23 | { |
| 24 | // Special case of null |
| 25 | if (to.IsEmpty()) |
| 26 | return from.IsEmpty(); |
| 27 | if (from.IsEmpty()) |
| 28 | return false; |
| 29 | |
| 30 | // Exact typename math |
| 31 | if (to == from) |
| 32 | return true; |
| 33 | |
| 34 | // Scripting Type match |
| 35 | const ScriptingTypeHandle typeHandleTo = Scripting::FindScriptingType(to); |
| 36 | const ScriptingTypeHandle typeHandleFrom = Scripting::FindScriptingType(from); |
| 37 | if (typeHandleTo && typeHandleFrom) |
| 38 | return typeHandleTo.IsAssignableFrom(typeHandleFrom); |
| 39 | |
| 40 | #if USE_CSHARP |
| 41 | // MClass match |
| 42 | const auto mclassTo = Scripting::FindClass(to); |
| 43 | const auto mclassFrom = Scripting::FindClass(from); |
| 44 | if (mclassTo && mclassFrom) |
| 45 | return mclassTo == mclassFrom || mclassFrom->IsSubClassOf(mclassTo); |
| 46 | #endif |
| 47 | |
| 48 | return false; |
| 49 | } |
| 50 | |
| 51 | BehaviorUpdateResult BehaviorTreeNode::InvokeUpdate(const BehaviorUpdateContext& context) |
| 52 | { |
no test coverage detected