Пример #1
0
 /// <summary>
 /// Event handler for when the customize drink button is clicked for a combo
 /// Sends the user to the correct customization screen
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void CustomizeDrinkClick(object sender, RoutedEventArgs e)
 {
     if (combo.Drink is WarriorWater w)
     {
         CustomizeWarriorWater custom         = new CustomizeWarriorWater(w, combo, true);
         OrderComponent        orderComponent = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
     else if (combo.Drink is SailorSoda s)
     {
         CustomizeSailorSoda custom         = new CustomizeSailorSoda(s, combo, true);
         OrderComponent      orderComponent = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
     else if (combo.Drink is AretinoAppleJuice a)
     {
         CustomizeAretinoAppleJuice custom         = new CustomizeAretinoAppleJuice(a, combo, true);
         OrderComponent             orderComponent = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
     else if (combo.Drink is MarkarthMilk m)
     {
         CustomizeMarkarthMilk custom         = new CustomizeMarkarthMilk(m, combo, true);
         OrderComponent        orderComponent = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
     else if (combo.Drink is CandlehearthCoffee c)
     {
         CustomizeCandlehearthCoffee custom = new CustomizeCandlehearthCoffee(c, combo, true);
         OrderComponent orderComponent      = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
 }
        /// <summary>
        /// Sets the menu pane to the custimization screen for the aretino apple juice
        /// </summary>
        /// <param name="sender"> used for click event</param>
        /// <param name="e">used for click event</param>
        public void customizeAAJ(object sender, RoutedEventArgs e)
        {
            Order ord;

            ord = (Order)parent.DataContext;
            CustomizeAretinoAppleJuice caj = new CustomizeAretinoAppleJuice(parent, new AretinoAppleJuice());

            parent.menuBorder.Child = caj;
            ord.Add((IOrderItem)caj.DataContext);
        }
        /// <summary>
        /// Click event for aretino apple juice that adds it to the order
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void aretinoAppleJuice_Click(object sender, RoutedEventArgs e)
        {
            AretinoAppleJuice          d  = new AretinoAppleJuice();
            CustomizeAretinoAppleJuice dd = new CustomizeAretinoAppleJuice(mw);

            dd.DataContext = d;
            var order = DataContext as Order;

            order.Add(d);
            mw.SwapScreen(new CustomizeAretinoAppleJuice(mw));
        }
 /// <summary>
 /// Click Event for switching the drink of the combo to Aretino Apple Juice and switches to its customization screen
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void AretinoAppleJuiceClick(object sender, RoutedEventArgs e)
 {
     if (DataContext is Order order)
     {
         AretinoAppleJuice aj = new AretinoAppleJuice();
         combo.Drink = aj;
         CustomizeAretinoAppleJuice temp = new CustomizeAretinoAppleJuice(menu, aj, order, combo);
         temp.doneButton.IsEnabled   = false;
         temp.cancelButton.IsEnabled = false;
         menu.orderBorder.Child      = temp;
     }
 }
Пример #5
0
        /// <summary>
        /// Click event to add a Aretino Apple Juice to the current order
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void AretinoAppleJuiceClick(object sender, RoutedEventArgs e)
        {
            AretinoAppleJuice aj   = new AretinoAppleJuice();
            Combo             temp = new Combo(null, null, null);

            if (DataContext is Order order)
            {
                order.Add(aj);
                CustomizeAretinoAppleJuice newScreen = new CustomizeAretinoAppleJuice(menu, aj, order, temp);
                newScreen.returnToOrderbutton.IsEnabled = false;
                menu.orderBorder.Child = newScreen;
            }
        }
Пример #6
0
 void AddAretinoAppleJuice(object sender, RoutedEventArgs e)
 {
     if (IsCombo)
     {
         c.Drink = new AretinoAppleJuice();
         CustomizeComboMeal custom         = new CustomizeComboMeal(c);
         OrderComponent     orderComponent = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
     if (DataContext is Order order)
     {
         AretinoAppleJuice a = new AretinoAppleJuice();
         order.Add(a);
         CustomizeAretinoAppleJuice custom         = new CustomizeAretinoAppleJuice(a, false);
         OrderComponent             orderComponent = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
 }
Пример #7
0
        /// <summary>
        /// Click event to edit an existing item in the current order
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditExistingItem(object sender, RoutedEventArgs e)
        {
            if (DataContext is Order order)
            {
                Combo temp        = new Combo(null, null, null);
                var   currentItem = ((Button)sender).DataContext;

                if (currentItem is BriarheartBurger bb)
                {
                    CustomizeBriarheartBurger screen = new CustomizeBriarheartBurger(menu, bb, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }

                else if (currentItem is DoubleDraugr dd)
                {
                    CustomizeDoubleDraugr screen = new CustomizeDoubleDraugr(menu, dd, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is GardenOrcOmelette goo)
                {
                    CustomizeGardenOrcOmelette screen = new CustomizeGardenOrcOmelette(menu, goo, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is PhillyPoacher php)
                {
                    CustomizePhillyPoacher screen = new CustomizePhillyPoacher(menu, php, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is SmokehouseSkeleton sks)
                {
                    CustomizeSmokehouseSkeleton screen = new CustomizeSmokehouseSkeleton(menu, sks, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is ThalmorTriple tt)
                {
                    CustomizeThalmorTriple screen = new CustomizeThalmorTriple(menu, tt, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }

                else if (currentItem is ThugsTBone ttb)
                {
                    CustomizeThugsTBone screen = new CustomizeThugsTBone(menu, ttb, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is AretinoAppleJuice aj)
                {
                    CustomizeAretinoAppleJuice screen = new CustomizeAretinoAppleJuice(menu, aj, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is CandlehearthCoffee chc)
                {
                    CustomizeCandlehearthCoffee screen = new CustomizeCandlehearthCoffee(menu, chc, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is MarkarthMilk mm)
                {
                    CustomizeMarkarthMilk screen = new CustomizeMarkarthMilk(menu, mm, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is SailorSoda ss)
                {
                    CustomizeSailorSoda screen = new CustomizeSailorSoda(menu, ss, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is WarriorWater ww)
                {
                    CustomizeWarriorWater screen = new CustomizeWarriorWater(menu, ww, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is DragonbornWaffleFries dwf)
                {
                    CustomizeDragonbornWaffleFries screen = new CustomizeDragonbornWaffleFries(menu, dwf, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is FriedMiraak fm)
                {
                    CustomizeFriedMiraak screen = new CustomizeFriedMiraak(menu, fm, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is MadOtarGrits mog)
                {
                    CustomizeMadOtarGrits screen = new CustomizeMadOtarGrits(menu, mog, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }
                else if (currentItem is VokunSalad vs)
                {
                    CustomizeVokunSalad screen = new CustomizeVokunSalad(menu, vs, order, temp);
                    screen.returnToOrderbutton.IsEnabled = false;
                    menu.orderBorder.Child = screen;
                }

                //Combo
                else if (currentItem is Combo c)
                {
                    menu.orderBorder.Child = new ComboControl(menu, c, order);
                }
            }
        }
        /// <summary>
        /// Used to reopen customization screen for any type of IOrderItem
        /// </summary>
        /// <param name="sender">used for selection event</param>
        /// <param name="e">used for selection event</param>
        private void itemsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            IOrderItem curItem = (IOrderItem)itemsListView.SelectedItem;

            if (curItem is BriarheartBurger bb)
            {
                CustomizeBriarheartBurger cbb = new CustomizeBriarheartBurger(this, bb);
                menuBorder.Child = cbb;
            }
            else if (curItem is DoubleDraugr dd)
            {
                CustomizeDoubleDraugr cdd = new CustomizeDoubleDraugr(this, dd);
                menuBorder.Child = cdd;
            }
            else if (curItem is GardenOrcOmelette gorc)
            {
                CustomizeGardenOrcOmelette cgorc = new CustomizeGardenOrcOmelette(this, gorc);
                menuBorder.Child = cgorc;
            }
            else if (curItem is PhillyPoacher pp)
            {
                CustomizePhillyPoacher cpp = new CustomizePhillyPoacher(this, pp);
                menuBorder.Child = cpp;
            }
            else if (curItem is SmokehouseSkeleton ss)
            {
                CustomizeSmokehouseSkeleton css = new CustomizeSmokehouseSkeleton(this, ss);
                menuBorder.Child = css;
            }
            else if (curItem is ThalmorTriple tt)
            {
                CustomizeThalmorTriple ctt = new CustomizeThalmorTriple(this, tt);
                menuBorder.Child = ctt;
            }
            else if (curItem is ThugsTBone thugst)
            {
                CustomizeThugsTBone cthugst = new CustomizeThugsTBone(this, thugst);
                menuBorder.Child = cthugst;
            }
            else if (curItem is AretinoAppleJuice aj)
            {
                CustomizeAretinoAppleJuice caj = new CustomizeAretinoAppleJuice(this, aj);
                menuBorder.Child = caj;
            }
            else if (curItem is CandlehearthCoffee cc)
            {
                CustomizeCandlehearthCoffee ccc = new CustomizeCandlehearthCoffee(this, cc);
                menuBorder.Child = ccc;
            }
            else if (curItem is MarkarthMilk mm)
            {
                CustomizeMarkarthMilk cmm = new CustomizeMarkarthMilk(this, mm);
                menuBorder.Child = cmm;
            }
            else if (curItem is SailorSoda sails)
            {
                CustomizeSailorSoda csails = new CustomizeSailorSoda(this, sails);
                menuBorder.Child = csails;
            }
            else if (curItem is WarriorWater ww)
            {
                CustomizeWarriorWater cww = new CustomizeWarriorWater(this, ww);
                menuBorder.Child = cww;
            }
            else if (curItem is DragonbornWaffleFries wf)
            {
                CustomizeDragonbornWaffleFries cwf = new CustomizeDragonbornWaffleFries(this, wf);
                menuBorder.Child = cwf;
            }
            else if (curItem is FriedMiraak fm)
            {
                CustomizeFriedMiraak cfm = new CustomizeFriedMiraak(this, fm);
                menuBorder.Child = cfm;
            }
            else if (curItem is MadOtarGrits mad)
            {
                CustomizeMadOtarGrits cmad = new CustomizeMadOtarGrits(this, mad);
                menuBorder.Child = cmad;
            }
            else if (curItem is VokunSalad vs)
            {
                CustomizeVokunSalad cvs = new CustomizeVokunSalad(this, vs);
                menuBorder.Child = cvs;
            }
            else if (curItem is Combo cmb)
            {
                CustomizeCombo ccmb = new CustomizeCombo(this, cmb);
                menuBorder.Child = ccmb;
            }
        }
Пример #9
0
        /// <summary>
        /// Event for when the user wants to customize an item that is already in their order
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnCustomizeClick(object sender, RoutedEventArgs e)
        {
            var item = orderList.SelectedItem;

            if (item is ComboMeal combo)
            {
                CustomizeComboMeal custom         = new CustomizeComboMeal(combo);
                OrderComponent     orderComponent = this.FindAncestor <OrderComponent>();
                orderComponent.Swap(custom);
            }
            else if (item is Drink drink)
            {
                if (drink is AretinoAppleJuice a)
                {
                    CustomizeAretinoAppleJuice custom         = new CustomizeAretinoAppleJuice(a, false);
                    OrderComponent             orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (drink is MarkarthMilk m)
                {
                    CustomizeMarkarthMilk custom         = new CustomizeMarkarthMilk(m, false);
                    OrderComponent        orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (drink is CandlehearthCoffee c)
                {
                    CustomizeCandlehearthCoffee custom = new CustomizeCandlehearthCoffee(c, false);
                    OrderComponent orderComponent      = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (drink is SailorSoda s)
                {
                    CustomizeSailorSoda custom         = new CustomizeSailorSoda(s, false);
                    OrderComponent      orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (drink is WarriorWater w)
                {
                    CustomizeWarriorWater custom         = new CustomizeWarriorWater(w, false);
                    OrderComponent        orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
            }

            else if (item is Entree entree)
            {
                if (entree is BriarheartBurger b)
                {
                    CustomizeBriarheartBurger custom         = new CustomizeBriarheartBurger(b, false);
                    OrderComponent            orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (entree is DoubleDraugr d)
                {
                    CustomizeDoubleDraugr custom         = new CustomizeDoubleDraugr(d, false);
                    OrderComponent        orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (entree is ThalmorTriple t)
                {
                    CustomizeThalmorTriple custom         = new CustomizeThalmorTriple(t, false);
                    OrderComponent         orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (entree is GardenOrcOmelette g)
                {
                    CustomizeGardenOrcOmelette custom         = new CustomizeGardenOrcOmelette(g, false);
                    OrderComponent             orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (entree is ThugsTBone tb)
                {
                    CustomizeThugsTBone custom         = new CustomizeThugsTBone(tb, false);
                    OrderComponent      orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (entree is SmokehouseSkeleton s)
                {
                    CustomizeSmokehouseSkeleton custom = new CustomizeSmokehouseSkeleton(s, false);
                    OrderComponent orderComponent      = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (entree is PhillyPoacher p)
                {
                    CustomizePhillyPoacher custom         = new CustomizePhillyPoacher(p, false);
                    OrderComponent         orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
            }
            else if (item is Side side)
            {
                if (side is DragonbornWaffleFries d)
                {
                    CustomizeDragonbornWaffleFries custom = new CustomizeDragonbornWaffleFries(d, false);
                    OrderComponent orderComponent         = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (side is FriedMiraak f)
                {
                    CustomizeFriedMiraak custom         = new CustomizeFriedMiraak(f, false);
                    OrderComponent       orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (side is MadOtarGrits m)
                {
                    CustomizeMadOtarGrits custom         = new CustomizeMadOtarGrits(m, false);
                    OrderComponent        orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
                else if (side is VokunSalad v)
                {
                    CustomizeVokunSalad custom         = new CustomizeVokunSalad(v, false);
                    OrderComponent      orderComponent = this.FindAncestor <OrderComponent>();
                    orderComponent.Swap(custom);
                }
            }
        }