When objects interact in game and are supposed to have some effect on one another what is the best way to accomplish this without violating encapsulation.
For example, say a projectile object collides with an enemy object, the projectile should terminate and display a small splash animation, and the enemy should take damage = to the damage value of the projectile. How does the enemy know the projectiles value? How do the know they collided? Some kind of entity manager class can check for collisions, but then it needs to know the positions and sizes of all the entities. I keep going around in circles trying to design something and always ends up needing to expose some part of one class to another. Either that or do something extreme, like make EVERYTHING derived from some abstract base class that has every conceivable method needed for game objects in virtual form.