So I am programming a small bot that will do different actions, like moving, interacting, grabbing, and more in a game. I made all of these actions to be functions of the same format (bool Move(int direction), bool Interact(int type), ...) and I wanted to put them into an array so that the bot only has to check through them once every time it wants to do something.
I've tried solutions I found on the internet (for void functions) like using a typedef, or this:
bool Move(int type);
bool Interact(int type);
bool (*baseAction[2])(int type) = { Move, Interact };
but it doesn't seem to work, it says that a value of type "bool (Character::)(int type)" cannot be used to initialize an entity of type "bool ()(int type)"
If someone understands how to make these, I would be extra grateful if you could also tell me how to do this on dynamic arrays like std::vector or std::list