This repository has been archived on 2022-11-09. You can view files and clone it, but cannot push or open issues or pull requests.
patterns-old/lesson_4/PizzaStore.hpp

31 lines
481 B
C++
Raw Normal View History

2021-11-02 18:18:09 +00:00
/*
* PizzaStore.hpp
*
* Created on: 2 нояб. 2021 г.
* Author: alexander
*/
#pragma once
#include "Pizza.hpp"
class PizzaStore
{
public:
virtual Pizza orderPizza(const std::string &type) const
{
Pizza pizza = createPizza(type);
pizza.prepare();
pizza.bake();
pizza.cut();
pizza.box();
return pizza;
}
virtual Pizza createPizza(const std::string &type) const = 0;
virtual ~PizzaStore() {}
};