-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuBuilder.cxx
More file actions
26 lines (25 loc) · 938 Bytes
/
MenuBuilder.cxx
File metadata and controls
26 lines (25 loc) · 938 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
#include <iostream>
#include <Views/MenuView.hpp>
#include <Controllers/BooksController.hpp>
#include <Controllers/UserController.hpp>
#include <MenuBuilder.hpp>
MenuBuilder::MenuBuilder(BooksController& booksController, UserController& userController, LoanBookController& loanBookController)
{
this->booksController = &booksController;
this->userController = &userController; // Initialize the UserController instance
this->loanBookController = &loanBookController; // Initialize LoanBookController as nullptr
this->menuView = new MenuView(booksController, userController, loanBookController); // Initialize the MenuView with the BooksController instance
}
void MenuBuilder::BuildMenu()
{
bool continueMenu = true;
while (continueMenu)
{
menuView->ShowMenu();
int option = menuView->ChooseOption();
continueMenu = menuView->SelectView(option);
}
}
MenuBuilder::~MenuBuilder()
{
}