In my client application I have two major components:
Core: wrapper that handles everything about running the actual application
NetworkClient: A layer that takes care of communicating (receiving/sending packets) with the server.
What I am not sure about is the way the NetworkClient should serve information to the Core process of the application. The core process has an event queue that is executed in update() calls. My initial idea is to have something like this:
- NetworkClient receives a snapshot of the state changes
- Takes that snapshot
- Chops it down to event objects for the Core process to handle.
The problem I see with that, isn't the NetworkClient class too dependent on the Core class? The opposite is not an issue however because, there can be a different client (UDP, TCP, etc) that works with the Core class.
So from a design point of view, is there a reason I might not want the NetworkClient class to be written for the specific implementation of the Core class?