BaseAppState group

I was wondering if I can group AppStates together.
If so, it’s a beginner question.
If not: then it is a suggestion for the next release.

The how-to describes AppStates to separate the start menu from the game.
How to use AppStates to draw animation, logic, map, etc. is described in some other posts.
These are different applications with the same tool.

To bring this together I have the question: Can I group the AppStates?

E.g .:

  • AppStateGroup_Menu
    – AppState_MainMenu
    – AppState_SelectAvatar
  • AppStateGroup_Game
    – AppState_Anim
    – AppState_Logic
    – AppState_Map
    – AppState_Player

The AppStateGroup would have similar (maybe smaler) interface as AppState. With disable and enable, maybe with or without update ans so on, AppStateGroup would pass the known commands on to the children.

If necessary, an AppStateGroup would also be just an AppState. Could of course program it myself.

Extra request (if not in StateManager, then at least in AppStateGroup):
I would have one AppState for players and two players. So I would have two instances of AppStatePlayer. With the “getAppState” method, however, I can only use the AppStatePlayer class, not a (possibly composite) key. I would like to have freely definable keys … Or a “getAppStates” method would at least provide all hits matching the class and not only the first that come up.

From my SiO2 library: GitHub - Simsilica/SiO2: Base pack of useful reusable game code that can help bootstrap any JME game project.

1 Like

Thank you very much.

You can register it with an ID.

And get it using that ID

1 Like

Oh, here, thank you very much.

1 Like

You’re welcome. :slightly_smiling_face: