We currently have the problem that our main class GameController
is being pulled into every backend file in our game. We're wondering what are common solutions to this problem.
Here's a bit more about the game architecture. The game is a board game, so since ~90-95% of the time there isn't anything happening, the game is set up more like a rest API. It waits for a user prompt, when received, the msg is distributed to the respective components of the game and the proper logic is executed. No large update loops, just executes logic when prompted.
The problem is that as this msg cascades through the system, GameController
acts more like a relay point between the systems. It's how the nodes communicate to each other so that all game components are updated properly. The problem is that it's created this system where all new/old classes contain a pointer to parentGame
, so GameController
is everywhere.
Are there any simple architectural solutions to avoid having every class contain a pointer to parentGame
? Is this necessarily a bad thing?
Aucun commentaire:
Enregistrer un commentaire