You could define a class like this:
class Event{ public: virtual int type() const=0;};
and then all events inherit Event:
enum EVENT_TYPE {PLAYER_MOVE /*, other events... */};class PlayerMoveEvent: public Event{ public: PlayerMoveEvent(float x,float y):x(x),y(y){} int type() const { return PLAYER_MOVE;} float x,y;};
then you need a function like
void postEvent(Object* receiver, Event* e) {...}
to post the event and delete it once it has been posted:
postEvent(Object ,new PlayerMoveEvent(10,10));
where object might itself post the event to other objects for example its children.
The receiver then uses type() to identify the Event:
if(e->type()==PLAYER_MOVE){ PlayerMoveEvent* player_move_event = static_cast<PlayerMoveEvent*>(e); // Do something useful with player_move_event // ...}
I wouldn't use events for most things you have listed. Events are generated when something actually has happen that might (or might not) interest other objects. PlayerMoveEvent can be used by another character to follow the player. If you want something to happen call a function:
createDialog(text,YES_NO_BUTTONS);
It's probably a good Idea to implement basic things like Event class in c++ and then make it available to the scripting engine (the other way doesn't work well in my experience), unless you are going to write the whole engine in script and think that you don't need events in c++ at all.