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