pepperonipizza.hpp

来自「一个皮萨店的源码。可以连锁的」· HPP 代码 · 共 30 行

HPP
30
字号
#ifndef	_HEAD_FIRST_DESIGN_PATTERNS_FACTORY_ABSTRACT_PEPPERONI_PIZZA_HPP_
#define _HEAD_FIRST_DESIGN_PATTERNS_FACTORY_ABSTRACT_PEPPERONI_PIZZA_HPP_

#include "Pizzaaf.hpp"

namespace HeadFirstDesignPatterns {
namespace Factory {
namespace Abstract {class PepperoniPizza : public Pizza {	private: PizzaIngredientFactory* ingredientFactory; 	public:  PepperoniPizza(PizzaIngredientFactory* ingredientFactory) {		this->ingredientFactory = ingredientFactory;	}	public: virtual void prepare() {		std::cout << "Preparing " << getName().c_str() << std::endl;		dough = ingredientFactory->createDough();		sauce = ingredientFactory->createSauce();		cheese = ingredientFactory->createCheese();		veggies = ingredientFactory->createVeggies();		pepperoni = ingredientFactory->createPepperoni();	}};} // namespace Abstract
} // namespace Factory
} // namespace HeadFirstDesignPatterns#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?