#pragma once #include "render/Renderer.h" #include "Environment.h" #include "render/TextureManager.h" #include "UiManager.h" namespace ZL { extern const char* CONST_ZIP_FILE; enum class GameState { MainMenu, AboutMenu, ShipSelectionSingle, ShipSelectionMulti, Connecting, ConnectionFailed, Gameplay, GameOver, HelpScreen, ConnectionLost }; class MenuManager { protected: Renderer& renderer; /* // Pre-loaded UI roots (loaded once in setupMenu) std::shared_ptr mainMenuRoot; std::shared_ptr aboutMenuRoot; std::shared_ptr shipSelectionRoot; std::shared_ptr connectingRoot; std::shared_ptr connectionFailedRoot; std::shared_ptr gameplayRoot; std::shared_ptr gameOverRoot; std::shared_ptr helpScreenRoot; std::shared_ptr connectionLostRoot; // Stored for multiplayer retry std::string pendingMultiNick; int pendingMultiShipType = 0; GameState state = GameState::MainMenu; // State transition methods void enterMainMenu(); void enterAboutMenu(); void enterShipSelectionSingle(); void enterShipSelectionMulti(); void enterConnecting(); void enterConnectionFailed(); void enterGameplay(); void enterGameOver(int score); void enterHelp(); void enterConnectionLost(); */ public: UiManager uiManager; MenuManager(Renderer& iRenderer); //void setupMenu(); /* // Returns true for states where Space should render and run (Gameplay, GameOver, ConnectionLost) bool shouldRenderSpace() const; GameState getState() const { return state; } // Called by game events void showGameOver(int score); void showConnectionLost(); void notifyConnected(); void notifyConnectionFailed(); // Callbacks set by Game/Space std::function onMainMenuEntered; std::function onRestartPressed; std::function onVelocityChanged; std::function onFirePressed; std::function onTakeButtonPressed; std::function onSingleplayerPressed; std::function onMultiplayerPressed; std::function onShowPlayersPressed; std::function forceSetupSpaceUICallback;*/ }; } // namespace ZL