Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#ifndef MENULIST_H
#define MENULIST_H
#include <iostream>
#include "mainmenu.h"
#include "playermenu.h"
#include "jobmenu.h"
#include "librarymenu.h"
#include "menuoptions.h"
#include "menuclass.h"
using namespace std;
class MenuList
{
MenuList()
{
}
int mList()
{
MenuSwitch* game = new MenuSwitch(); // declares a pointer (game) and allocates memory to (size of(MenuSwitch))
MainMenu* mainMenu = new MainMenu(game);
PlayerMenu* playerMenu = new PlayerMenu(game);
JobMenu* jobMenu = new JobMenu(game);
LibraryMenu* libraryMenu = new LibraryMenu(game);
game->assignMenu(mainMenu, playerMenu, jobMenu, libraryMenu);
cout << "Input 0 to exit the game." << endl;
cout << "Input 9 for Main Menu." << endl;
cout << "Input 8 for Player Menu." << endl;
cout << "Input 7 for Job Menu." << endl;
cout << "Input 6 for Library Menu" << endl;
int menuInput;
cin >> menuInput;
while (true)
{
if (menuInput == 0)
{
return 0;
}
if (menuInput == 9 || menuInput == 8 || menuInput == 7 || menuInput == 6)
{
game->currentMenu->update(menuInput);
}
else
{
cout << "Input 9,8,7, or 6 to change menu, or 0 to exit the game." << endl;
}
cin >> menuInput;
}
}
};
#endif