/// <summary> /// Selects meat type and updates image /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MeatRadioButtons_Click(object sender, EventArgs e) { CustomPizza pizza = (CustomPizza)currentPizza; if (sender == chickenRadioButton) { pizza.PizzaMeat = CustomPizza.Meat.Chicken; } else if (sender == sausageRadioButton) { pizza.PizzaMeat = CustomPizza.Meat.Sausage; } else if (sender == beefRadioButton) { pizza.PizzaMeat = CustomPizza.Meat.Beef; } else { pizza.PizzaMeat = CustomPizza.Meat.Pepperoni; } // update image pizza.AddTopping(pizza.PizzaMeat); orderPictureBox.Image = pizza.GetImage(); }
/// <summary> /// Selects which side of pizza to apply veggie topping and updates image /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void VeggiesSizeImages_Click(object sender, EventArgs e) { CustomPizza pizza = (CustomPizza)currentPizza; if (sender == veggiesLeftPicturebox) { pizza.VeggiesSide = CustomPizza.Side.Left; // update side images veggiesLeftPicturebox.Image = Constants.ButtonLeftSelected; veggiesMiddlePictureBox.Image = Constants.ButtonWhole; veggiesRightPicturebox.Image = Constants.ButtonRight; } else if (sender == veggiesRightPicturebox) { pizza.VeggiesSide = CustomPizza.Side.Right; // update side images veggiesLeftPicturebox.Image = Constants.ButtonLeft; veggiesMiddlePictureBox.Image = Constants.ButtonWhole; veggiesRightPicturebox.Image = Constants.ButtonRightSelected; } else { pizza.VeggiesSide = CustomPizza.Side.Both; // update side images veggiesLeftPicturebox.Image = Constants.ButtonLeft; veggiesMiddlePictureBox.Image = Constants.ButtonWholeSelected; veggiesRightPicturebox.Image = Constants.ButtonRight; } // update image pizza.AddTopping(pizza.PizzaVeggies); orderPictureBox.Image = pizza.GetImage(); }
/// <summary> /// Selects which size of pizza to apply topping and updates image /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MeatSideImages_Click(object sender, EventArgs e) { CustomPizza pizza = (CustomPizza)currentPizza; if (sender == meatLeftPictureBox) { pizza.MeatSide = CustomPizza.Side.Left; // update side images meatLeftPictureBox.Image = Constants.ButtonLeftSelected; meatMiddlePicturebox.Image = Constants.ButtonWhole; meatRightPicturebox.Image = Constants.ButtonRight; } else if (sender == meatRightPicturebox) { pizza.MeatSide = CustomPizza.Side.Right; // update side images meatLeftPictureBox.Image = Constants.ButtonLeft; meatMiddlePicturebox.Image = Constants.ButtonWhole; meatRightPicturebox.Image = Constants.ButtonRightSelected; } else { pizza.MeatSide = CustomPizza.Side.Both; // update side images meatLeftPictureBox.Image = Constants.ButtonLeft; meatMiddlePicturebox.Image = Constants.ButtonWholeSelected; meatRightPicturebox.Image = Constants.ButtonRight; } pizza.AddTopping(pizza.PizzaMeat); orderPictureBox.Image = pizza.GetImage(); }
/// <summary> /// Selects veggie type and updates image /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void VeggiesRadioButtons_Click(object sender, EventArgs e) { CustomPizza pizza = (CustomPizza)currentPizza; if (sender == mushroomsRadioButton) { pizza.PizzaVeggies = CustomPizza.Veggies.Mushrooms; } else if (sender == broccoliRadioButton) { pizza.PizzaVeggies = CustomPizza.Veggies.Broccoli; } else { pizza.PizzaVeggies = CustomPizza.Veggies.Spinach; } // update image pizza.AddTopping(pizza.PizzaVeggies); orderPictureBox.Image = pizza.GetImage(); }