예제 #1
0
 // Clone Constructor
 public Category(Category c)
 {
     this.name = c.name;
     this.imagepath = c.imagepath;
     this.foods = c.foods;
     this.altimagepath = c.altimagepath;
 }
예제 #2
0
        protected ItemList foods; // Contains the possible Foods for a category.

        #endregion Fields

        #region Constructors

        // Main Constructor
        public Category(string n, string i, ItemList f, string a = "")
        {
            this.name = n;
            this.imagepath = i;
            this.foods = f;
            if (a == "") // if no alternate image is provided
                this.altimagepath = i;
            else
                this.altimagepath = a;
        }
예제 #3
0
 // <Important>
 // Returns all multi-selected items in a new ItemList.
 public ItemList ReturnMultiple()
 {
     ItemList newlist = new ItemList();
     for (int i = 0; i < this.Count(); i++)
     {
         if (multiselected[i])
         {
             newlist.Add(this.Item(i));
         }
     }
     return newlist;
 }
예제 #4
0
 // Clone Constructor
 public ItemList(ItemList i)
 {
     this.items = i.items;
     this.selected = i.selected;
     this.multiselected = i.multiselected;
 }
예제 #5
0
 // Clone Constructor
 public Food(Food f)
 {
     this.name = f.name;
     this.price = f.price;
     this.imagepath = f.imagepath;
     this.sizes = f.sizes;
     this.amounts = f.amounts;
     this.options = f.options;
     this.altimagepath = f.altimagepath;
 }
예제 #6
0
        protected ItemList sizes; // Contains the possible sizes for a Food. Cost of each size is stored in price!

        #endregion Fields

        #region Constructors

        // Main Constructor
        public Food(string n, string i, ItemList s, ItemList a, ItemList o, double p = 0, string alt = "")
        {
            this.name = n;
            this.price = p;
            this.imagepath = i;
            this.sizes = s;
            this.amounts = a;
            this.options = o;
            if (alt == "") // if no alternate image is provided
                this.altimagepath = i;
            else
                this.altimagepath = alt;
        }
예제 #7
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            trashBackground = new ImageBrush();
            trashBackground.ImageSource = new BitmapImage(new Uri("Images/trashbackground.png", UriKind.Relative));

            kinectSensorChooser1.KinectSensorChanged += new DependencyPropertyChangedEventHandler(kinectSensorChooser1_KinectSensorChanged);
            //test.Text = "CAKE";
            SwipeTimer.Tick += new EventHandler(ResetSwipe);
            SwipeTimer.Interval = TimeSpan.FromSeconds(SwipeDelay);

            // Amounts
            Item one = new Item("1", "Images/number1.jpg", 1.0);
            Item two = new Item("2", "Images/number2.jpg", 2.0);
            Item three = new Item("3", "Images/number3.jpg", 3.0);
            ItemList allAmounts = new ItemList(new Item[] { one, two, three });
            // Food Sizes
            Item burgerRegSize = new Item("Regular", null, 4.0);
            Item burgerJumboSize = new Item("Jumbo", null, 5.5);
            Item sandwichRegSize = new Item("Regular", null, 4.5);
            Item sandwichJumboSize = new Item("Jumbo", null, 6.0);
            Item friesSmallSize = new Item("Small", null, 1.5);
            Item friesMedSize = new Item("Medium", null, 2.5);
            Item friesLargeSize = new Item("Large", null, 3.0);
            Item sodaSmallSize = new Item("Small", null, 1.5);
            Item sodaMedSize = new Item("Medium", null, 2.0);
            Item sodaLargeSize = new Item("Large", null, 2.5);
            Item bobaSmallSize = new Item("Small", null, 2.0);
            Item bobaMedSize = new Item("Medium", null, 2.5);
            Item bobaLargeSize = new Item("Large", null, 3.0);
            // Food Options
            Item noneOption = new Item("None", null, 0.0);
            Item cheeseOption = new Item("Cheese", null, 1.0);
            Item picklesOption = new Item("Pickles", null, 0.0);
            Item onionsOption = new Item("Onions", null, 0.0);
            Item ranchOption = new Item("Ranch Dressing", null, 0.0);
            Item italianOption = new Item("Italian Dressing", null, 0.0);
            Item chiliCheeseOption = new Item("Chili Cheese", null, 1.5);
            Item cokeOption = new Item("Coke", null, 0.0);
            Item pepsiOption = new Item("Pepsi", null, 0.0);
            Item spriteOption = new Item("Sprite", null, 0.0);
            Item bobaOption = new Item("With Pearls", null, 0.0);
            // Foods
            // Meals
            ItemList burgerSizes = new ItemList(new Item[] { burgerRegSize, burgerJumboSize });
            ItemList burgerOptions = new ItemList(new Item[] { noneOption, cheeseOption, picklesOption, onionsOption });
            burger = new Food("Hamburger", "Images/hamburger.png", burgerSizes, allAmounts, burgerOptions); //base price needed?
            ItemList sandwichSizes = new ItemList(new Item[] { sandwichRegSize, sandwichJumboSize });
            chicksandwich = new Food("Chicken Sandwich", "Images/chicken_sandwich.png", sandwichSizes, allAmounts, burgerOptions);
            ItemList saladOptions = new ItemList(new Item[] { noneOption, cheeseOption, italianOption, ranchOption });
            bigsalad = new Food("Big Salad", "Images/big_salad.jpg", null, allAmounts, saladOptions, 5.0);
            // Sides
            ItemList friesSizes = new ItemList(new Item[] { friesSmallSize, friesMedSize, friesLargeSize });
            ItemList friesOptions = new ItemList(new Item[] { noneOption, chiliCheeseOption });
            fries = new Food("French Fries", "Images/french_fries.png", friesSizes, allAmounts, friesOptions);
            sidesalad = new Food("Side Salad", "Images/side_salad.png", null, allAmounts, saladOptions, 2.5);
            fruit = new Food("Fruit Salad", "Images/fruit_cup.png", null, allAmounts, null, 3.0);
            // Drinks
            ItemList sodaSizes = new ItemList(new Item[] { sodaSmallSize, sodaMedSize, sodaLargeSize });
            ItemList sodaOptions = new ItemList(new Item[] { cokeOption, pepsiOption, spriteOption });
            soda = new Food("Soft Drink", "Images/soda.png", sodaSizes, allAmounts, sodaOptions);
            ItemList bobaSizes = new ItemList(new Item[] { bobaSmallSize, bobaMedSize, bobaLargeSize });
            ItemList bobaOptions = new ItemList(new Item[] { noneOption, bobaOption });
            boba = new Food("Boba Tea", "Images/boba.png", bobaSizes, allAmounts, bobaOptions);
            water = new Food("Water", "Images/water.png", null, allAmounts, null);
            // Categories
            meals = new Category("Meals", "Images/meals.png", new ItemList(new Item[] {burger, chicksandwich, bigsalad}));
            sides = new Category("Sides", "Images/sides.png", new ItemList(new Item[] {fries, sidesalad, fruit}));
            drinks = new Category("Drinks", "Images/drinks.png", new ItemList(new Item[] {soda, boba, water}));

            // The top menu containing the food categories.
            menu = new ItemList(new Item[] { meals, sides, drinks });
            // The list containing items in the order
            order = new ItemList();

            // Set up the stackpanel rows
            catCol = new Image[] { cat1, cat2, cat3 };
            amountCol = new Label[] {amount1, amount2, amount3};
            itemCol = new Image[] {item1, item2, item3};
            sizeCol = new Label[] {size1, size2, size3};
            optionsCol = new Label[] {option1, option2, option3};

            // Display logic
            editing = false;
            Category.Background = selectedBackground;
            menu.Display(catCol); // display categories in first row
            Category selectedCategory = (Category)menu.ReturnSingle();
            selectedCategory.DisplayFoods(itemCol); // display selected category's food in item row
            hideOrderOptions();
        }
예제 #8
0
 private Food currentItem()
 {
     Category category = ((Category)menu.ReturnSingle());
     Food food = category.Food();
     ItemList itemSize = null;
     ItemList itemOptions = null;
     if (food.Sizes() != null) {
         itemSize = new ItemList(new Item[] { food.Sizes().ReturnSingle() });
     }
     ItemList itemAmount = new ItemList(new Item[] { food.Amounts().ReturnSingle() });
     if (food.Options() != null) { itemOptions = new ItemList(new Item[] { food.Options().ReturnSingle() }); } //could be multiple in the future
     return new Food(food.Name(), food.Image(), itemSize, itemAmount, itemOptions, food.TotalPrice());
 }