76 lines
1.4 KiB
C++
76 lines
1.4 KiB
C++
/*
|
||
* Pizza.hpp
|
||
*
|
||
* Created on: 2 нояб. 2021 г.
|
||
* Author: alexander
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
#include <iostream>
|
||
#include <list>
|
||
|
||
class Pizza
|
||
{
|
||
private:
|
||
std::string name;
|
||
std::string dough;
|
||
std::string sauce;
|
||
std::list<std::string> toppings;
|
||
public:
|
||
|
||
virtual void prepare() const
|
||
{
|
||
std::cout << "Preparing " << name << std::endl;
|
||
std::cout << "Tossing dough..." << std::endl;
|
||
std::cout << "Adding sauce..." << std::endl;
|
||
std::cout << "Adding toppings:" << std::endl;
|
||
for (const std::string &topping : toppings)
|
||
{
|
||
std::cout << '\t' << topping << std::endl;
|
||
}
|
||
}
|
||
|
||
virtual void bake() const
|
||
{
|
||
std::cout << "Bake for 25 minutes at 350" << std::endl;
|
||
}
|
||
|
||
virtual void cut() const
|
||
{
|
||
std::cout << "Cutting the pizza into diagonal slices" << std::endl;
|
||
}
|
||
|
||
virtual void box() const
|
||
{
|
||
std::cout << "Place pizza in official PizzaStore box" << std::endl;
|
||
}
|
||
|
||
virtual std::string getName() const
|
||
{
|
||
return name;
|
||
}
|
||
|
||
virtual void setName(std::string name)
|
||
{
|
||
this->name = name;
|
||
}
|
||
|
||
virtual void setDough(std::string dough)
|
||
{
|
||
this->dough = dough;
|
||
}
|
||
|
||
virtual void setSauce(std::string sauce)
|
||
{
|
||
this->sauce = sauce;
|
||
}
|
||
|
||
virtual void addTopping(std::string topping)
|
||
{
|
||
toppings.push_back(topping);
|
||
}
|
||
|
||
virtual ~Pizza() {}
|
||
};
|