Question about game engine object oriented design.
Let’s say I have an engine with a main loop, and many handlers that will be executed by the main loop every time on next iteration of main loop. So every handler will be invoked frequently, and can do necessary game logic that needs to be run in a loop.
Having many handler of the main loop, I can implement modular system, and separate different concerns in different handlers.
Every of this modules not necessary will have a visual representation on the scene, it just any process that should run in main loop.
What is name convention for such classes. I need to give some suffix for class. What is industry standard for naming class prefixes like that?
——
I saw few examples like:
while(true) {
update(…)
render(…)
}
Instead I would like to do something like:
loopHandler = [
new UpdateGamePlayerPosition(),
new UpdateAiPosition(),
…
new RenderScene(),
new SendNetworkUpdates()
]
while(true) {
for(loopHandler in handlerCollection) {
loopHandler.execute(gameLoopEvent)
}
}
——
The reason why I needs suffixes, it came from my web/enterprise experience. Let’s say I have a Player in the game, now I need to have a PlayerLoop to refresh his PlayerEntity state, also PlayerSceneObject for rendering, also I may need to transfer it over network, so I will have PlayerTransferObject, also I might want to save into save game file PlayerSaveObject.