| 891 | |
| 892 | template <typename... VarArgs> |
| 893 | Variant call(const StringName &p_method, VarArgs... p_args) { |
| 894 | Variant args[sizeof...(p_args) + 1] = { p_args..., Variant() }; // +1 makes sure zero sized arrays are also supported. |
| 895 | const Variant *argptrs[sizeof...(p_args) + 1]; |
| 896 | for (uint32_t i = 0; i < sizeof...(p_args); i++) { |
| 897 | argptrs[i] = &args[i]; |
| 898 | } |
| 899 | Callable::CallError cerr; |
| 900 | const Variant ret = callp(p_method, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args), cerr); |
| 901 | return (cerr.error == Callable::CallError::CALL_OK) ? ret : Variant(); |
| 902 | } |
| 903 | |
| 904 | /// Depending on the boolean, we call either the virtual function _notification_backward or _notification_forward. |
| 905 | /// - Forward calls subclasses in descending order (e.g. Object -> Node -> Node3D -> extension -> script). |
no test coverage detected