Let us say that I have a simple architecture, and I have implemented event-based communication between the objects and the components. In this architecture, Game
has GameObject
s, and the GameObject
s have Component
s.
GameObjects have reference to Game and Components have reference to the GameObject.
There is no shared interface between these objects. Is it worth making an interface to implement Update()
and ReceiveMessage()
, and then only store these interface pointers?
For example, should I store Component
pointers in a GameObject
, or I should make an EventListener
interface with Update()
and ReceiveMessage()
, and store EventListener
pointers? I think this is a good way to force modularity, but maybe I am over complicating it.