You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add methods to get argument count of methods
Added to: * `Callable`s * `Object`s * `ClassDB` * `Script(Instance)`s
This commit is contained in:
@@ -91,6 +91,14 @@ const Callable *CallableCustomBind::get_base_comparator() const {
|
||||
return callable.get_base_comparator();
|
||||
}
|
||||
|
||||
int CallableCustomBind::get_argument_count(bool &r_is_valid) const {
|
||||
int ret = callable.get_argument_count(&r_is_valid);
|
||||
if (r_is_valid) {
|
||||
return ret - binds.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CallableCustomBind::get_bound_arguments_count() const {
|
||||
return callable.get_bound_arguments_count() + binds.size();
|
||||
}
|
||||
@@ -225,6 +233,14 @@ const Callable *CallableCustomUnbind::get_base_comparator() const {
|
||||
return callable.get_base_comparator();
|
||||
}
|
||||
|
||||
int CallableCustomUnbind::get_argument_count(bool &r_is_valid) const {
|
||||
int ret = callable.get_argument_count(&r_is_valid);
|
||||
if (r_is_valid) {
|
||||
return ret + argcount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CallableCustomUnbind::get_bound_arguments_count() const {
|
||||
return callable.get_bound_arguments_count() - argcount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user