I want to add a callback function to list which will cause the callback to be called with one parameter at the appropriate time. However, I also want the callback to be passed another variable as well.
Note: I am used to std::bind
or boost::bind
in c++, so i was looking for something like that.
Note: This is in Python by the way.
Example of problem with collisions:
def collision_callback(hit, hitter)
# doing something relevant...
object = create_object()
collision_callbacks.append(collision_callback(_1, object)) # _1 is a placeholder from C++ lol.
# as you can see here _1 is expected
# to be filled in with the hit object.