001package headfirst.factory.pizzaaf;
002
003public class PepperoniPizza extends Pizza {
004        PizzaIngredientFactory ingredientFactory;
005
006        public PepperoniPizza(PizzaIngredientFactory ingredientFactory) {
007                this.ingredientFactory = ingredientFactory;
008        }
009
010        void prepare() {
011                System.out.println("Preparing " + name);
012                dough = ingredientFactory.createDough();
013                sauce = ingredientFactory.createSauce();
014                cheese = ingredientFactory.createCheese();
015                veggies = ingredientFactory.createVeggies();
016                pepperoni = ingredientFactory.createPepperoni();
017        }
018}