public static IshtarObject *IsInstanceOf(CallFrame frame, IshtarObject * @this, RuntimeIshtarClass @class) { if ([email protected]_inited) { @class.init_vtable(); } if (@this == null) { return(null); } if (@class.IsInterface) { return(IsInstanceOfByRef(frame, @this, @class)); } return(IsAssignableFrom(frame, @class, @this->decodeClass()) ? @this : null); }
public static bool IsAssignableFrom(CallFrame frame, RuntimeIshtarClass c1, RuntimeIshtarClass c2) { if (!c1.is_inited) { c1.init_vtable(); } if (!c2.is_inited) { c2.init_vtable(); } // TODO: Array detection // TODO: Generic detection // TODO: Interfrace detection if (c1.FullName == VeinCore.ObjectClass.FullName) { return(true); } return(c1.IsInner(c2)); }