So, I'm trying to use events to decouple the code I have, and here is my problem:
class WorldHandler
{
public void Notify(object sender, EventArgs e)
{
if (e is CameraMovedEventArgs)
{
}
if (e is MapLoaded)
{
}
}
}
The WorldHandler class listens for different subsystems of my application. Does this not mean that WorldHandler is still connected to other subsystems? Wouldn't it be the same to access those subsystems inside this class directly?
If it is difficult for me to understand what I ask, I will add additional information to my post.
I did research on this issue, and I still find it confusing because different people have very different opinions on how to separate your code from events.
source
share