scene.Scene should interpret nil values as noops.
lolbinarycat opened this issue · 0 comments
lolbinarycat commented
Sometimes you might have a scene that's logic is entirely governed by bound events, and doesn't need the loop
field. Or maybe you don't need startup code (yet).
Currently, in these cases you still would have to type out the function and it's type signature (which can be fairly long, especially in start and end).
What I think we should do, is have a simple nil check in oak.AddScene
. If any of the fields are nil
, replace it with it's noop function.
The main question is what to do for scene.Loop
, as it is unclear whether the default behavior should be to go to the next scene immediately, or stay on the current scene forever. There are also a few other options:
- Don't support this for
scene.Loop
- Loop infinitely if
scene.End
isnil
, and go to the next scene otherwise (my current preference) - Add an option for it in
oak.SetupConfig
(I don't like this).