/// <summary> /// This will return whether or not this class implements the passed in class / interface /// </summary> /// <param name="someInterface">the interface to check and see if this class implements it</param> /// <returns></returns> public bool ImplementsInterface(UClass someInterface) { if (someInterface != null && someInterface.HasAnyClassFlags(EClassFlags.Interface)) { return(Native_UClass.ImplementsInterface(Address, someInterface.Address)); } return(false); }
/// <summary> /// Returns true if this objects class implements the given IInterface derived type /// (call this on UObject instances; if you are working with a UClass call ImplementsInterface() instead).<para/> /// This is the equivalent of UKismetSystemLibrary::DoesImplementInterface(). /// This is also the same as obj.GetClass().ImplementsInterface(). /// </summary> /// <typeparam name="T">The IInterface derived type</typeparam> /// <returns>True if this objects class implements the given IInterface derived type</returns> public bool DoesImplementInterface <T>() where T : IInterface { IntPtr interfaceClass = UClass.GetInterfaceClassAddress <T>(); if (interfaceClass != IntPtr.Zero && Native_UClass.GetClassFlags(interfaceClass).HasFlag(EClassFlags.Interface)) { return(Native_UClass.ImplementsInterface(Native_UObjectBase.GetClass(Address), interfaceClass)); } return(false); }
/// <summary> /// Returns true if this objects class implements the given IInterface derived type /// (call this on UObject instances; if you are working with a UClass call ImplementsInterface() instead).<para/> /// This is the equivalent of UKismetSystemLibrary::DoesImplementInterface(). /// This is also the same as obj.GetClass().ImplementsInterface(). /// </summary> /// <param name="type">The IInterface derived type</param> /// <returns>True if this objects class implements the given IInterface derived type</returns> public bool DoesImplementInterface(Type type) { UClass interfaceClass = UClass.GetClass(type); if (interfaceClass != null && interfaceClass.ClassFlags.HasFlag(EClassFlags.Interface)) { return(Native_UClass.ImplementsInterface(Native_UObjectBase.GetClass(Address), interfaceClass.Address)); } return(false); }