Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Menue.h"
- Menue::Menue()
- {
- menue_cocktail_machine_ = new CocktailMachine;
- }
- Menue::~Menue()
- {
- }
- void Menue::menue_Menue()
- {
- do
- {
- cout << "== CocktailMix | V0.1 ==" << endl;
- cout << "1 - Make Cocktails" << endl;
- cout << "2 - Configure CocktailMix" << endl;
- cout << "0 - Exit" << endl;
- cout << "Selection: ";
- std::cin >> selection;
- switch (selection)
- {
- case 1: std::system("cls");
- submenue_makecocktails();
- break;
- case 2: std::system("cls");
- submenue_configure_cocktail();
- break;
- case 0: std::system("cls");
- cout << "Program is closing.." << endl;
- exit(EXIT_SUCCESS);
- default: std::system("cls");
- cout << "wrong input" << endl;
- break;
- }
- } while (selection != 0);
- }
- void Menue::submenue_makecocktails()
- {
- system("cls");
- cout << "== CocktailMix | Mix it ==" << endl;
- for (int i = 0; i < menue_cocktail_machine_->getCocktails().size(); ++i)
- {
- cout << i+1 << " - " << menue_cocktail_machine_->getCocktails().at(i)->getCocktailName() << endl;
- }
- cout << "Selection: ";
- std::cin >> selection;
- if (selection > 0 && selection <= menue_cocktail_machine_->getCocktails().size())
- {
- menue_cocktail_machine_->getCocktails().at(selection - 1)->printCocktail();
- std::cin.ignore();
- getchar();
- }
- }
- void Menue::submenue_configure_cocktail()
- {
- cout << "== CocktailMix | Configure ==" << endl;
- cout << "1 - Configure Dispensers" << endl;
- cout << "2 - List Cocktail" << endl;
- cout << "3 - Add Cocktail" << endl;
- cout << "4 - Edit Cocktail" << endl;
- cout << "5 - Delete Cocktail" << endl;
- cout << "0 - Exit" << endl;
- cout << "Selection: ";
- std::cin >> selection;
- switch(selection)
- {
- case 1: submenue_configure_dispensers();
- break;
- case 2:
- break;
- case 3:
- break;
- case 4:
- break;
- case 5:
- break;
- case 0: std::system("cls");
- menue_Menue();
- break;
- default: std::system("cls");
- cout << "wrong input" << endl;
- break;
- }
- }
- void Menue::submenue_configure_dispensers()
- {
- std::system("cls");
- cout << "== CocktailMix | Configure Dispenser ==" << endl;
- for (int i = 0; i < 6; ++i)
- {
- cout << i + 1 << " - " << menue_cocktail_machine_->getDispenser()[i]->getDispenserIngredient()->getIngredientName() << endl;
- }
- cout << "0 - Exit" << endl;
- cout << "Selection: ";
- std::cin >> selection;
- submenue_configure_ingredient(selection - 1);
- }
- void Menue::submenue_configure_ingredient(const int dispenserPos)
- {
- Ingredient* tmp_ingredient = new Ingredient;
- cout << "== CocktailMix | Select Ingredient ==" << endl;
- for (int i = 0; i < menue_cocktail_machine_->getIngredients().size(); ++i)
- {
- cout << i + 1 << " - " << menue_cocktail_machine_->getIngredients()[i]->getIngredientName() << endl;
- }
- cout << "0 - Free / Exit" << endl;
- cout << "Selection: ";
- std::cin >> selection;
- if(selection == 0)
- {
- string free = "FREE";
- tmp_ingredient = new Ingredient;
- tmp_ingredient->setIngredientName(free);
- menue_cocktail_machine_->getDispenser().at(dispenserPos)->setDispenserIngredient(tmp_ingredient);
- /*
- *
- *ingredientName = "FREE";
- *tmp_ingredient->setIngredientName(ingredientName);
- *menue_cocktail_machine_->getDispenser().at(dispenserPos)->setDispenserIngredient(tmp_ingredient);
- *tmp_ingredient = new Ingredient;
- *
- */
- }
- else
- {
- tmp_ingredient = menue_cocktail_machine_->getIngredients().at(selection - 1);
- menue_cocktail_machine_->getDispenser().at(dispenserPos)->setDispenserIngredient(tmp_ingredient);
- /*
- *
- *ingredientName = menue_cocktail_machine_->getIngredients().at(selection - 1)->getIngredientName();
- *tmp_ingredient->setIngredientName(ingredientName);
- *menue_cocktail_machine_->getDispenser().at(dispenserPos)->setDispenserIngredient(tmp_ingredient);
- *tmp_ingredient = new Ingredient;
- *
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement