Original Post
I am creating a 2d game engine, and could use some advice / direction on a few areas.
Currently I am using a singleton EventManager class that registers Event Handlers. Event handlers have the ability to send events to the Event Manager to be distributed to other handlers. Events are just structs with the event information and a identifying variable for the purpose of proper typecasting.
My issue is that I have Managers for many parts of my engine like Graphics, Sound, Actors, etc. Currently I find myself holding references between Managers and calling appropriate methods from that reference. This has all of my Managers coupled and makes me feel uneasy for some reason....
My question is would it be better to uncouple all my managers and pass events / processes using my EventManager, or keep my Managers coupled?
If I uncouple I think I will have to use void* and reinterpret_cast calls to properly typecast my event data in some cases, which also makes me feel very uneasy.
Currently I am using a singleton EventManager class that registers Event Handlers. Event handlers have the ability to send events to the Event Manager to be distributed to other handlers. Events are just structs with the event information and a identifying variable for the purpose of proper typecasting.
My issue is that I have Managers for many parts of my engine like Graphics, Sound, Actors, etc. Currently I find myself holding references between Managers and calling appropriate methods from that reference. This has all of my Managers coupled and makes me feel uneasy for some reason....
My question is would it be better to uncouple all my managers and pass events / processes using my EventManager, or keep my Managers coupled?
If I uncouple I think I will have to use void* and reinterpret_cast calls to properly typecast my event data in some cases, which also makes me feel very uneasy.