interface
| 639 | |
| 640 | // interface |
| 641 | asIScriptFunction *asCScriptEngine::CreateDelegate(asIScriptFunction *func, void *obj) |
| 642 | { |
| 643 | if( func == 0 || obj == 0 ) |
| 644 | return 0; |
| 645 | |
| 646 | // The function must be a class method |
| 647 | asITypeInfo *type = func->GetObjectType(); |
| 648 | if( type == 0 ) |
| 649 | return 0; |
| 650 | |
| 651 | // The object type must allow handles |
| 652 | if( (type->GetFlags() & asOBJ_REF) == 0 || (type->GetFlags() & (asOBJ_SCOPED | asOBJ_NOHANDLE)) ) |
| 653 | return 0; |
| 654 | |
| 655 | // Create the delegate the same way it would be created by the scripts |
| 656 | return AS_NAMESPACE_QUALIFIER CreateDelegate(reinterpret_cast<asCScriptFunction*>(func), obj); |
| 657 | } |
| 658 | |
| 659 | asCScriptEngine::asCScriptEngine() |
| 660 | { |