First at all, I'm not asking how to handle or detect collision. I already have that.
My actual situation is, I have a system collision and I detect the collisions. Every collision detected is store as a message containing the two entities colliding with some information like type of collision or something. Later, all messages is processed.
I'm trying to figure out how to implement the reaction of the entities in every collision with that message. In the game a collision can trigger an action like talking with another, change the level, kill the character, store an object, not letting go...
I don't want to hard-code the calls and methods if possible (in my ideal world,I can define even the behaviour in an xml an read from that!). My first approach is a class where I store a list of possible actions/callback functions and attach it to the entity as a component. When a collision succed, I go to the entity and depending of the collision, execute the correspond callback.
Still I don't know how to determine the callback to execute or where I must code the behaviour. Any ideas? What you think about this approach?
By the way, I'm building everything from scratch, with c++ and SFML and following the entity system approach, for educational purpose.