/// <summary>
        /// Click event for warriorWaterButton. Opens warrior water customization screen when button is clicked.
        /// </summary>
        /// <param name="sender">Reference to the object that raised the event.</param>
        /// <param name="e">Contains the event data.</param>
        void OpenWarriorWaterCustomization(object sender, RoutedEventArgs e)
        {
            var wwCustomization = new WarriorWaterCustomization((Order)this.DataContext, false, null);

            fullMenuSelectionGrid.Children.Clear();
            WarriorWater ww = new WarriorWater();

            ((Order)this.DataContext).Add(ww);
            wwCustomization.DataContext = ww;
            fullComponentBorder.Child   = wwCustomization;
        }
 /// <summary>
 /// Click event for warriorWaterButton. Opens warrior water customization screen when button is clicked.
 /// </summary>
 /// <param name="sender">Reference to the object that raised the event.</param>
 /// <param name="e">Contains the event data.</param>
 void OpenWarriorWaterCustomization(object sender, RoutedEventArgs e)
 {
     if (((Combo)this.DataContext).Drink is WarriorWater oldww)
     {
         var wwCustomization = new WarriorWaterCustomization(currentOrder, true, (Combo)this.DataContext);
         wwCustomization.DataContext = oldww;
         fullComponentBorder.Child   = wwCustomization;
     }
     else
     {
         var          wwCustomization = new WarriorWaterCustomization(currentOrder, true, (Combo)this.DataContext);
         WarriorWater ww = new WarriorWater();
         ((Combo)this.DataContext).Drink = ww;
         wwCustomization.DataContext     = ww;
         fullComponentBorder.Child       = wwCustomization;
     }
 }
Example #3
0
        /// <summary>
        /// Given an IOrderItem <paramref name="item"/>, a customization screen is generated, and the correct
        /// <paramref name="text"/> is given back.
        /// </summary>
        /// <param name="item">The menu item to generate a customization screen for.</param>
        /// <param name="text">The text that will be displayed on the screen.</param>
        /// <returns>The customization screen for the specific item.</returns>
        public static CustomizationScreen GetCustomizationScreen(IOrderItem item, out string text)
        {
            CustomizationScreen screen = null;

            text = "Unknown";

            if (item is BriarheartBurger)
            {
                screen = new BriarheartBurgerCustomization(); text = "Customize Briarheart Burger";
            }
            else if (item is DoubleDraugr)
            {
                screen = new DoubleDraugrCustomization(); text = "Customize Double Draugr";
            }
            else if (item is GardenOrcOmelette)
            {
                screen = new GardenOrcOmeletteCustomization(); text = "Customize Garden Orc Omelette";
            }
            else if (item is PhillyPoacher)
            {
                screen = new PhillyPoacherCustomization(); text = "Customize Philly Poacher";
            }
            else if (item is SmokehouseSkeleton)
            {
                screen = new SmokehouseSkeletonCustomization(); text = "Customize Smokehouse Skeleton";
            }
            else if (item is ThalmorTriple)
            {
                screen = new ThalmorTripleCustomization(); text = "Customize Thalmor Triple";
            }
            else if (item is ThugsTBone)
            {
                screen = new ThugsTBoneCustomization(); text = "Customize ThugsTBone";
            }
            else if (item is AretinoAppleJuice)
            {
                screen = new AretinoAppleJuiceCustomization(); text = "Customize Aretino Apple Juice";
            }
            else if (item is CandlehearthCoffee)
            {
                screen = new CandlehearthCoffeeCustomization(); text = "Customize Candlehearth Coffee";
            }
            else if (item is MarkarthMilk)
            {
                screen = new MarkarthMilkCustomization(); text = "Customize Markarth Milk";
            }
            else if (item is SailorSoda)
            {
                screen = new SailorSodaCustomization(); text = "Customize Sailor Soda";
            }
            else if (item is WarriorWater)
            {
                screen = new WarriorWaterCustomization(); text = "Customize Warrior Water";
            }
            else if (item is Combo)
            {
                screen = new ComboCustomization(); text = "Customize Combo";
            }
            else
            {
                screen = new SideCustomization();
                if (item is DragonbornWaffleFries)
                {
                    text = "Customize Dragonborn Waffle Fries";
                }
                else if (item is FriedMiraak)
                {
                    text = "Customize Fried Miraak";
                }
                else if (item is MadOtarGrits)
                {
                    text = "Customize Mad Otar Grits";
                }
                else if (item is VokunSalad)
                {
                    text = "Customize Vokun Salad";
                }
            }

            screen.DataContext = item;

            return(screen);
        }
        /// <summary>
        /// this class sets a new instance of the
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">represents a food object passed from FoodSelected event handler</param>
        public void FoodButtonClickEvent(object sender, MenuSelectionEvent e)
        {
            //now how can we use the information from Custimization...
            //to make changes to e.fooditem which is the new BriarheartBurger()
            //final goal ->   use BriarheartBurger.SpecialInstructions

            //we need to find a better way of capturing fooditem's customization information
            //FinalOrderListView.Items.Add("Briarheart Burger");

            //entrees
            if (e.fooditem is BriarheartBurger) // this will check if an object is a certain type
            {
                BriarheartBurgerCustomization fooditem = new BriarheartBurgerCustomization(e.fooditem);
                switchBorder.Child   = fooditem; //add burger customization to the current screen
                fooditem.DataContext = e.fooditem;

                //fooditem.DataContext = e.fooditem; //allows the DataContext of the XAML variables to access BriarheartBurger
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is DoubleDraugr) // this will check if an object is a certain type
            {
                DoubleDraugrCustomization fooditem = new DoubleDraugrCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                // fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is ThalmorTriple) // this will check if an object is a certain type
            {
                ThalmorTripleCustomization fooditem = new ThalmorTripleCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is SmokehouseSkeleton) // this will check if an object is a certain type
            {
                SmokehouseSkeletonCustomization fooditem = new SmokehouseSkeletonCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is GardenOrcOmelette) // this will check if an object is a certain type
            {
                GardenOrcOmeletteCustomization fooditem = new GardenOrcOmeletteCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is PhillyPoacher) // this will check if an object is a certain type
            {
                PhillyPoacherCustomization fooditem = new PhillyPoacherCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is ThugsTBone) // this will check if an object is a certain type
            {
                ThugsTBoneCustomization fooditem = new ThugsTBoneCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }


            //drinks
            else if (e.fooditem is SailorSoda)
            {
                SailorSodaCustomization fooditem = new SailorSodaCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is MarkarthMilk)
            {
                MarkarthMilkCustomization fooditem = new MarkarthMilkCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                // fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is AretinoAppleJuice)
            {
                AretinoAppleJuiceCustomization fooditem = new AretinoAppleJuiceCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is CandlehearthCoffee)
            {
                CandlehearthCoffeeCustomization fooditem = new CandlehearthCoffeeCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is WarriorWater)
            {
                WarriorWaterCustomization fooditem = new WarriorWaterCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            //sides:
            else if (e.fooditem is VokunSalad)
            {
                VokunSaladCustomization fooditem = new VokunSaladCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is FriedMiraak)
            {
                FriedMiraakCustomization fooditem = new FriedMiraakCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is MadOtarGrits)
            {
                MadOtarGritsCustomization fooditem = new MadOtarGritsCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is DragonbornWaffleFries)
            {
                DragonbornWaffleFriesCustomization fooditem = new DragonbornWaffleFriesCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
                //finalOrder.Add(e.fooditem); //only need once below
            }

            // finalOrder.Add(e.fooditem); //add food item to the list of IOrderItem

            newOrder.Add(e.fooditem); //setting everything up for newOrder

            DisplayCurrentOrder();
        }
        /// <summary>
        /// Event when an item in the order list is selected. Opens the customization screen for that item.
        /// </summary>
        /// <param name="sender">Reference to the object that raised the event</param>
        /// <param name="e">Contains the event data.</param>
        void ChangeItemSelected(object sender, SelectionChangedEventArgs e)
        {
            var item = orderList.SelectedItem;

            if (item is Combo co)
            {
                ComboCustomization coc = new ComboCustomization((Order)this.DataContext);
                coc.DataContext = co;
                mscBorder.Child = coc;
            }
            else if (item is AretinoAppleJuice aj)
            {
                AretinoAppleJuiceCustomization ajc = new AretinoAppleJuiceCustomization(((Order)this.DataContext), false, null);
                ajc.DataContext = aj;
                mscBorder.Child = ajc;
            }
            else if (item is CandlehearthCoffee cc)
            {
                CandlehearthCoffeeCustomization ccc = new CandlehearthCoffeeCustomization(((Order)this.DataContext), false, null);
                ccc.DataContext = cc;
                mscBorder.Child = ccc;
            }
            else if (item is MarkarthMilk mm)
            {
                MarkarthMilkCustomization mmc = new MarkarthMilkCustomization(((Order)this.DataContext), false, null);
                mmc.DataContext = mm;
                mscBorder.Child = mmc;
            }
            else if (item is SailorSoda ss)
            {
                SailorSodaCustomization ssc = new SailorSodaCustomization(((Order)this.DataContext), false, null);
                ssc.DataContext = ss;
                mscBorder.Child = ssc;
            }
            else if (item is WarriorWater ww)
            {
                WarriorWaterCustomization wwc = new WarriorWaterCustomization(((Order)this.DataContext), false, null);
                wwc.DataContext = ww;
                mscBorder.Child = wwc;
            }
            else if (item is BriarheartBurger bb)
            {
                BriarheartBurgerCustomization bbc = new BriarheartBurgerCustomization(((Order)this.DataContext), false, null);
                bbc.DataContext = bb;
                mscBorder.Child = bbc;
            }
            else if (item is DoubleDraugr dd)
            {
                DoubleDraugrCustomization ddc = new DoubleDraugrCustomization(((Order)this.DataContext), false, null);
                ddc.DataContext = dd;
                mscBorder.Child = ddc;
            }
            else if (item is GardenOrcOmelette goo)
            {
                GardenOrcOmeletteCustomization gooc = new GardenOrcOmeletteCustomization(((Order)this.DataContext), false, null);
                gooc.DataContext = goo;
                mscBorder.Child  = gooc;
            }
            else if (item is PhillyPoacher pp)
            {
                PhillyPoacherCustomization ppc = new PhillyPoacherCustomization(((Order)this.DataContext), false, null);
                ppc.DataContext = pp;
                mscBorder.Child = ppc;
            }
            else if (item is SmokehouseSkeleton sms)
            {
                SmokehouseSkeletonCustomization smsc = new SmokehouseSkeletonCustomization(((Order)this.DataContext), false, null);
                smsc.DataContext = sms;
                mscBorder.Child  = smsc;
            }
            else if (item is ThalmorTriple tt)
            {
                ThalmorTripleCustomization ttc = new ThalmorTripleCustomization(((Order)this.DataContext), false, null);
                ttc.DataContext = tt;
                mscBorder.Child = ttc;
            }
            else if (item is ThugsTBone ttb)
            {
                ThugsTBoneCustomization ttbc = new ThugsTBoneCustomization(((Order)this.DataContext), false, null);
                ttbc.DataContext = ttb;
                mscBorder.Child  = ttbc;
            }
            else if (item is DragonbornWaffleFries dwf)
            {
                DragonbornWaffleFriesCustomization dwfc = new DragonbornWaffleFriesCustomization(((Order)this.DataContext), false, null);
                dwfc.DataContext = dwf;
                mscBorder.Child  = dwfc;
            }
            else if (item is FriedMiraak fm)
            {
                FriedMiraakCustomization fmc = new FriedMiraakCustomization(((Order)this.DataContext), false, null);
                fmc.DataContext = fm;
                mscBorder.Child = fmc;
            }
            else if (item is MadOtarGrits mog)
            {
                MadOtarGritsCustomization mogc = new MadOtarGritsCustomization(((Order)this.DataContext), false, null);
                mogc.DataContext = mog;
                mscBorder.Child  = mogc;
            }
            else if (item is VokunSalad vs)
            {
                VokunSaladCustomization vsc = new VokunSaladCustomization(((Order)this.DataContext), false, null);
                vsc.DataContext = vs;
                mscBorder.Child = vsc;
            }
        }