Permalink
Cannot retrieve contributors at this time
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?
PineapplePen/mainmenu.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
60 lines (51 sloc)
1.2 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MAINMENU_H | |
#define MAINMENU_H | |
#include <iostream> | |
#include <string> | |
//#include <windows.h> | |
#include "playermenu.h" | |
#include "menuoptions.h" | |
#include "librarymenu.h" | |
#include "menuclass.h" | |
using namespace std; | |
class MainMenu : public Menu //class name | |
{ | |
public: // access specifier | |
MainMenu(MenuSwitch* myGame) //paramatised constructor | |
{ | |
game = myGame; | |
} | |
MainMenu() //default constructor | |
{ | |
} | |
void mmenu(); | |
void print() | |
{ | |
mmenu(); | |
} | |
void update(int input) | |
{ | |
if (input == 2) | |
{ | |
//Line below changes the value stored in currentMenu to the input from the player. | |
game->currentMenu = game->menuOption[input]; //game = pointer_name, holds value in variable_name. | |
cout << "Menu changed to player menu" << endl; | |
} | |
else if (input == 3) | |
{ | |
game->currentMenu = game->menuOption[input]; | |
cout << "Menu changed to job menu" << endl; | |
} | |
else if (input == 4) | |
{ | |
game->currentMenu = game->menuOption[input]; | |
cout << "Menu changed to library menu" << endl; | |
} | |
else if (input == 1) | |
{ | |
cout << "Menu unchanged - still main menu" << endl; | |
mmenu(); | |
} | |
} | |
}; | |
#endif | |