Original Post
Looking for ideas on dependence in a game engine.
It would be nice to be able to explicitly plan dependencies before hand. But is this possible? Any resources on this would be appreciated.
What I usually end up with is:
-Game objects are 'managed' by higher level code
-Game objects are composed of lower level components
This seems to result in the higher level code has to know about all the differentiated implementations of the lower-level parts (resulting in switches that need to be changed when adding lower level code).
One explanation I have seen is to provide interfaces between different parts of the code that doesn't rely on the specific implementation. I think this was using C#. In C++, can this be achieved by using a 'base' class as the interface to the derived classes? So far I have avoided using virtual functions but maybe it is too limiting without.
Any thoughts on this are appreciated.
It would be nice to be able to explicitly plan dependencies before hand. But is this possible? Any resources on this would be appreciated.
What I usually end up with is:
-Game objects are 'managed' by higher level code
-Game objects are composed of lower level components
This seems to result in the higher level code has to know about all the differentiated implementations of the lower-level parts (resulting in switches that need to be changed when adding lower level code).
One explanation I have seen is to provide interfaces between different parts of the code that doesn't rely on the specific implementation. I think this was using C#. In C++, can this be achieved by using a 'base' class as the interface to the derived classes? So far I have avoided using virtual functions but maybe it is too limiting without.
Any thoughts on this are appreciated.