Skip to content

Commit

Permalink
Added Sequences and Spawners to Tween class
Browse files Browse the repository at this point in the history
This allows creating very complicated tweening branching trees in a
readable way without having to manage delays manually.
  • Loading branch information
eligt committed Aug 12, 2018
1 parent d5d83b7 commit 485f9e9
Show file tree
Hide file tree
Showing 3 changed files with 350 additions and 81 deletions.
54 changes: 54 additions & 0 deletions core/class_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,60 @@ class ClassDB {
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 6);
}

template <class N, class M>
static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7) {

MethodBind *bind = create_method_bind(p_method);
const Variant *ptr[7] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7 };

return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 12);
}

template <class N, class M>
static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7, const Variant &p_def8) {

MethodBind *bind = create_method_bind(p_method);
const Variant *ptr[8] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7, &p_def8 };

return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 12);
}

template <class N, class M>
static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7, const Variant &p_def8, const Variant &p_def9) {

MethodBind *bind = create_method_bind(p_method);
const Variant *ptr[9] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7, &p_def8, &p_def9 };

return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 12);
}

template <class N, class M>
static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7, const Variant &p_def8, const Variant &p_def9, const Variant &p_def10) {

MethodBind *bind = create_method_bind(p_method);
const Variant *ptr[10] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7, &p_def8, &p_def9, &p_def10 };

return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 12);
}

template <class N, class M>
static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7, const Variant &p_def8, const Variant &p_def9, const Variant &p_def10, const Variant &p_def11) {

MethodBind *bind = create_method_bind(p_method);
const Variant *ptr[11] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7, &p_def8, &p_def9, &p_def10, &p_def11 };

return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 12);
}

template <class N, class M>
static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7, const Variant &p_def8, const Variant &p_def9, const Variant &p_def10, const Variant &p_def11, const Variant &p_def12) {

MethodBind *bind = create_method_bind(p_method);
const Variant *ptr[12] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7, &p_def8, &p_def9, &p_def10, &p_def11, &p_def12 };

return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 12);
}

template <class M>
static MethodBind *bind_vararg_method(uint32_t p_flags, StringName p_name, M p_method, const MethodInfo &p_info = MethodInfo(), const Vector<Variant> &p_default_args = Vector<Variant>()) {

Expand Down
Loading

0 comments on commit 485f9e9

Please sign in to comment.