33 lines
687 B
C++
33 lines
687 B
C++
|
/*
|
|||
|
* CheesePizza.hpp
|
|||
|
*
|
|||
|
* Created on: 3 нояб. 2021 г.
|
|||
|
* Author: alexander
|
|||
|
*/
|
|||
|
|
|||
|
#pragma once
|
|||
|
|
|||
|
#include "Pizza.hpp"
|
|||
|
#include "PizzaIngredientFactory.hpp"
|
|||
|
|
|||
|
class CheesePizza: public Pizza
|
|||
|
{
|
|||
|
public:
|
|||
|
PizzaIngredientFactory *ingredientFactory;
|
|||
|
|
|||
|
CheesePizza(PizzaIngredientFactory *ingredientFactory) : ingredientFactory(ingredientFactory) {}
|
|||
|
|
|||
|
void prepare() override
|
|||
|
{
|
|||
|
std::cout << "Preparing " << getName() << std::endl;
|
|||
|
setDough(ingredientFactory->createDough());
|
|||
|
setSauce(ingredientFactory->createSauce());
|
|||
|
setCheese(ingredientFactory->createCheese());
|
|||
|
}
|
|||
|
|
|||
|
~CheesePizza()
|
|||
|
{
|
|||
|
delete ingredientFactory;
|
|||
|
}
|
|||
|
};
|