MCPcopy Create free account
hub / github.com/NotYetGames/DlgSystem / IsObjectImplementingInterface

Method IsObjectImplementingInterface

Source/DlgSystem/Private/DlgHelper.cpp:163–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163bool FDlgHelper::IsObjectImplementingInterface(const UObject* Object, const UClass* InterfaceClass)
164{
165 if (!Object || !InterfaceClass)
166 {
167 return false;
168 }
169
170 // Blueprint
171 if (const UBlueprint* Blueprint = Cast<UBlueprint>(Object))
172 {
173 if (const UClass* GeneratedClass = Cast<UClass>(Blueprint->GeneratedClass))
174 {
175 return GeneratedClass->ImplementsInterface(InterfaceClass);
176 }
177 }
178
179 // A class object, does this ever happen?
180 if (const UClass* Class = Cast<UClass>(Object))
181 {
182 return Class->ImplementsInterface(InterfaceClass);
183 }
184
185 // All other object types
186 return Object->GetClass()->ImplementsInterface(InterfaceClass);
187}
188
189bool FDlgHelper::GetAllChildClassesOf(const UClass* ParentClass, TArray<UClass*>& OutNativeClasses, TArray<UClass*>& OutBlueprintClasses)
190{

Callers

nothing calls this directly

Calls 1

GetClassMethod · 0.80

Tested by

no test coverage detected