I've got a collision response/resolution function that does the same for any pair of two entities. It's is in the
World class right now.
But right before that function is invoked, I have some entity-specific logic:
- A specific pair of entities should never have their collisions resolved (this is literally to keep the player from hitting itself with a carried object)
- When two specific entities collide, an event should be triggered
Because of this, I'm starting to wonder if I should move the collision resolution function as a method into
Entity, that'd allow me to use polymorphism. However, this sound very messy to me: If both entities involved in a collision can resolve it, how can I figure out which one should do it?
Is there another way to move these special cases out of