MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_method_argument_count

Method get_method_argument_count

modules/mono/csharp_script.cpp:1675–1701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1673}
1674
1675int CSharpInstance::get_method_argument_count(const StringName &p_method, bool *r_is_valid) const {
1676 if (!script->is_valid() || !script->valid) {
1677 if (r_is_valid) {
1678 *r_is_valid = false;
1679 }
1680 return 0;
1681 }
1682
1683 const CSharpScript *top = script.ptr();
1684 while (top != nullptr) {
1685 for (const CSharpScript::CSharpMethodInfo &E : top->methods) {
1686 if (E.name == p_method) {
1687 if (r_is_valid) {
1688 *r_is_valid = true;
1689 }
1690 return E.method_info.arguments.size();
1691 }
1692 }
1693
1694 top = top->base_script.ptr();
1695 }
1696
1697 if (r_is_valid) {
1698 *r_is_valid = false;
1699 }
1700 return 0;
1701}
1702
1703Variant CSharpInstance::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
1704 ERR_FAIL_COND_V(script.is_null(), Variant());

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.65
is_validMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected