-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cpp
More file actions
39 lines (35 loc) · 720 Bytes
/
Menu.cpp
File metadata and controls
39 lines (35 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <fstream>
#include "Menu.h"
#include "linkedlist.h"
#include <utility>
using namespace std;
void Menu::printItem()
{
for (const auto& temp : items)
{
cout << "\033[36m" << temp.second << ": " << "\033[0m";
temp.first->display();
}
}
void Menu::addItem (linkedlist* head,string type)
{
auto temp = make_pair(head,type);
items.push_back(temp);
}
bool Menu::isItInMenu(string item)
{
bool exist = 0;
for (const auto& temp : items)
{
exist = temp.first->searchInLinkedlist(item);
if(exist)
{
return exist;
}
}
return exist;
}