#ifndef __CONSOLEMENU_H #define __CONSOLEMENU_H #include #include #include class menuBase{ public: static std::string cutline; std::string titleText; //title std::vector options; //options std::vector infos; //help info std::string menuID; //Must be unique. int numOfStatus; int highLightedIndex; //from 0 to numOfStatus virtual void DrawMenu(); virtual void StatusMove(int status) = 0; virtual void beginOutPut(){}; virtual void endOutPut(){}; }; class menuManager{ public: std::vector menus; //menus menuBase* activeMenu; //current menu std::string defaultMenu = ""; private: menuManager(); static menuManager *instance; //API public: void SetDefaultUI(std::string menuID); void UIRegistion(menuBase* pmenu); void UITransform(std::string menuID); static menuManager* (GetInstance()){ if(instance == nullptr){ instance = new menuManager(); if(instance == nullptr){exit(1);} //alloc failed } return instance; } }; #endif