// SuperTux
-// Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
+// Copyright (C) 2009 Ingo Ruhnke <grumbel@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
#ifndef HEADER_SUPERTUX_SUPERTUX_MENU_MENU_STORAGE_HPP
#define HEADER_SUPERTUX_SUPERTUX_MENU_MENU_STORAGE_HPP
+#include <memory>
+
class JoystickMenu;
class KeyboardMenu;
class Menu;
class MenuStorage
{
+private:
+ static MenuStorage* s_instance;
public:
- MenuStorage();
+ static MenuStorage& instance();
+
+public:
+ enum MenuId {
+ NO_MENU,
+ MAIN_MENU,
+ OPTIONS_MENU,
+ INGAME_OPTIONS_MENU,
+ PROFILE_MENU,
+ CONTRIB_MENU,
+ CONTRIB_WORLD_MENU,
+ ADDON_MENU,
+ LANGUAGE_MENU,
+ KEYBOARD_MENU,
+ JOYSTICK_MENU,
+ WORLDMAP_MENU,
+ WORLDMAP_CHEAT_MENU,
+ GAME_MENU,
+ CHEAT_MENU
+ };
- static OptionsMenu* get_options_menu();
- static ProfileMenu* get_profile_menu();
- static KeyboardMenu* get_key_options_menu();
- static JoystickMenu* get_joystick_options_menu();
+public:
+ MenuStorage();
+ ~MenuStorage();
-private:
- static OptionsMenu* options_menu;
- static ProfileMenu* profile_menu;
- static KeyboardMenu* key_options_menu;
- static JoystickMenu* joystick_options_menu;
+ std::unique_ptr<Menu> create(MenuId menu_id);
private:
MenuStorage(const MenuStorage&);