I’m curious how folks use AppStates… so I made a poll:
I use one of the AppState base classes like I’m supposed to.
I’m a rebel and just implement the AppState interface directly.
What’s an AppState?
Reasoning: I would like to add a getId():String method to the AppState interface and then default implementations to the base classes. This would “harm” only those who implement AppState directly.
Adding the method is WAY easier and cleaner than having an interim IdentifiableAppState interface or somesuch.
The idea here is to be able to lookup AppStates by ID instead of just class. Useful when you have something like a ViewPortState and want to get the “rootNode” viewport versus the “guiNode” viewport, for example.
well im not sure why someone would want expand AppState interace since there is AbstractAppState/BaseAppState to make own AppState. (that is anyway low level)
since for example “public class BulletAppState implements AppState” this do not extend Abstract layer, just interface, so you would need add it to multiple Classes. (just dont forget about AbstractAppState/BaseAppState )
By the way, this means we can now have 2 instances of the same AppState class?
I’ve believed that AppStates and Controls are the same thing, except for you can have only 1 instance of AppState, instead you can have multiple Controls (but must be attached to some Spatial). Am I wrong?
I think is going to be really good for adding instances of the same class, but maybe it can be done with something like the ElementId, that way it can be added as a child, and then you can get an array of states of a parent as well as an indivial state.
This is what i imagine how it could be used