33 lines
570 B
C++
33 lines
570 B
C++
/*
|
||
* PizzaStore.hpp
|
||
*
|
||
* Created on: 3 нояб. 2021 г.
|
||
* Author: alexander
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
#include "Pizza.hpp"
|
||
|
||
class PizzaStore
|
||
{
|
||
public:
|
||
virtual Pizza* orderPizza(const std::string &type) const
|
||
{
|
||
Pizza *pizza = createPizza(type);
|
||
|
||
std::cout << "--- Making a " << pizza->getName() << " ---" << std::endl;
|
||
|
||
pizza->prepare();
|
||
pizza->bake();
|
||
pizza->cut();
|
||
pizza->box();
|
||
|
||
return pizza;
|
||
}
|
||
|
||
virtual Pizza* createPizza(const std::string &type) const = 0;
|
||
|
||
virtual ~PizzaStore() {}
|
||
};
|