本文整理汇总了C++中MainMenu::outMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ MainMenu::outMenu方法的具体用法?C++ MainMenu::outMenu怎么用?C++ MainMenu::outMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainMenu
的用法示例。
在下文中一共展示了MainMenu::outMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
//Declare Variables
char wasd = ' '; // Holds player's movement
char *loc = 0; // Holds player location
char **arrMap1; // For allocating memory
int locX = 0; // Holds X location
int locY = 0; // Holds Y location
int turn = 0; // Holds turns taken
int menuIn = 0; // Holds menu input
int debug[0]; // Converts char to int for debug file
bool isGameRunning = true; // Checks if game is still running
bool action = false; // Checks if player is fighting
//Define objects
Player p;
Map map1;
MainMenu menu;
//Allocate instances
Speechbox *sB = new Playerbox();
Playerbox *pB = new Playerbox();
Pickupbox *pU = new Pickupbox();
//Build FileStream object
FileStream f;
//Display menu and prompt for choice
f.readFile("Main.mnu", 0, 0);
cin >> menuIn;
//If 3, display help screen
if(menuIn == 3)
{
system("cls");
f.readFile("help.mnu", 0, 0);
cout << "\nPress Enter to start game\n";
_getch();
system("cls");
}
//If 4, exit and don,t bother set or output
else if(menuIn == 4){ cout << "\nGoodbye!\n"; exit(EXIT_SUCCESS); }
//If not 3, set and output menu
menu.setInN(menuIn);
menu.outMenu(menuIn);
//If load game fail, prompt
if(menu.getIsCodeGood() == false)
{
//Prompt for user info
cin >> p;
//Prompt for map properties
cin >> map1;
}