wintermute-cell / cowboy-gorl

0 stars 0 forks source link

Better entity and scene management #12

Closed wintermute-cell closed 1 year ago

wintermute-cell commented 1 year ago

Problem Description

Currently, Init, Deinit, Draw, Update, ... functions are called manually. This provides the benefit of being able to easily manually order when which element is drawn, but also causes a lot of boilerplate and carries a high risk of bugs by forgetting to call one of the functions.

Solution Approach

Implement an automatic system, where a scene or entity only has to be "registered"/"spawned" once, and will automatically be handled from there on. This system must still provide precise control over the rendering/update order. Most likely the Init order is also important. For this aspect, it would most likely be best to implement some "dependency" system that Inits dependencies before their dependents.

wintermute-cell commented 1 year ago

This is most likely relevant here: https://github.com/wintermute-cell/cowboy-gorl/issues/7#issuecomment-1708893197

wintermute-cell commented 1 year ago

Implemented SceneManager in 4d1346449308603c37414eb2e8c054f75bd64004

wintermute-cell commented 1 year ago

Implemented EntityManager in c02dce4deac64bc3dfd432c5c9812f45dd81ad2f

wintermute-cell commented 1 year ago

Add dependency checking to EntityManager with a0721a1a4c7ce7d5ee5e90e25e228d0057e9379f