I created a simple game engine using Allegro but I stuck because I get circular dependencies. Main classes are Game.h and Engine.h.
Engine handles game loop, updates, rendering, input. It's also configured to take these inputs from outside.
Game class creates actual Engine, runs and exits the application, but it also has a list of scenes so that it could potentially load a different scene. It passes scene updates/rendering to Engine class because Engine is built to use IEngineCore and scenes inherit from IEngineCore.
IEngineCore is just a simple interface with Destroy(), Update() and Render() methods.
The problem is that I got circular dependency. This is because I would like to change to scene 2 from scene 1. To accomplish this I though to call Game.LoadScene() from the 1-st scene so I could change it. But when I try to do that, since Game already has scenes, it doesn't allow me to call Game.LoadScene() from Scene class. Here I have a circular dependency and the app won't compile.
Do you have any thoughts on how could I call Game.LoadScene() from Scene class?