55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
/*
|
||
* ChicagoPizzaStore.hpp
|
||
*
|
||
* Created on: 3 нояб. 2021 г.
|
||
* Author: alexander
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
#include "PizzaStore.hpp"
|
||
#include "CheesePizza.hpp"
|
||
#include "PepperoniPizza.hpp"
|
||
#include "VeggiePizza.hpp"
|
||
#include "ClamPizza.hpp"
|
||
#include "StandardPizza.hpp"
|
||
#include "NYPizzaIngredientFactory.hpp"
|
||
|
||
class ChicagoPizzaStore: public PizzaStore
|
||
{
|
||
public:
|
||
Pizza* createPizza(const std::string &type) const override
|
||
{
|
||
Pizza *pizza = NULL;
|
||
PizzaIngredientFactory *ingredientFactory = new NYPizzaIngredientFactory();
|
||
|
||
if (type == "cheese")
|
||
{
|
||
pizza = new CheesePizza(ingredientFactory);
|
||
pizza->setName("Chicago Style Cheese Pizza");
|
||
}
|
||
else if (type == "veggie")
|
||
{
|
||
pizza = new VeggiePizza(ingredientFactory);
|
||
pizza->setName("Chicago Style Veggie Pizza");
|
||
}
|
||
else if (type == "clam")
|
||
{
|
||
pizza = new ClamPizza(ingredientFactory);
|
||
pizza->setName("Chicago Style Clam Pizza");
|
||
}
|
||
else if (type == "pepperoni")
|
||
{
|
||
pizza = new PepperoniPizza(ingredientFactory);
|
||
pizza->setName("Chicago Style Pepperoni Pizza");
|
||
}
|
||
else
|
||
{
|
||
pizza = new StandardPizza(ingredientFactory);
|
||
pizza->setName("Chicago Style Standard Pizza");
|
||
}
|
||
|
||
return pizza;
|
||
}
|
||
};
|