I want to have a defined object, which contains a certain state each system may use during its run. The state object should be generated before any system runs and destroyed after all systems are finished.
In order to handle the generation, a custom function may be supplied, which receives the old state object. If no handler is supplied, the state object will contain a value passed to the run() or displatch() methods (for example undefined).
The state object should be frozen, so that systems don't accidentally change it, which would lead to different behavior based on system order, which spells chaos in capital letters.
The motivation for this is to allow things like a central simulation-state, frame-based events (input), etc. to hook directly into the ECS and be synchronized.
I want to have a defined object, which contains a certain state each system may use during its run. The state object should be generated before any system runs and destroyed after all systems are finished.
In order to handle the generation, a custom function may be supplied, which receives the old state object. If no handler is supplied, the state object will contain a value passed to the
run()
ordisplatch()
methods (for exampleundefined
).The state object should be frozen, so that systems don't accidentally change it, which would lead to different behavior based on system order, which spells chaos in capital letters.
The motivation for this is to allow things like a central simulation-state, frame-based events (input), etc. to hook directly into the ECS and be synchronized.