Why not have a global message queue, something like:
messageQueue.push_back(shared_ptr<Event>(new DamageEvent(entityB, 10, entityA)));
With:
DamageEvent(Entity* toDamage, uint amount, Entity* damageDealer);
And at the end of the game loop/event handling:
<code><br>
while(!messageQueue.empty())
{<br> Event e = messageQueue.front(); <br>messageQueue.pop_front(); <br>e.Execute();
}
</code>
<br>
I think this is the Command pattern. And Execute() is a pure virtual in Event, which derivatives define and do stuff. So here:
<code> DamageEvent::Execute() {
<br>toDamage->takeDamage(amount); //Or of course, you could now have entityA get points, or a recognition of damage, or anything.
<br>
}
</code>