public static BaseDrinkModel BuildDrink(DrinkCategories category, string drinkType, bool isCarbonated, int alcoholContent)
 {
     return(category switch
     {
         DrinkCategories.Alcoholic => new AlcoholicDrinkModel(drinkType, isCarbonated, alcoholContent),
         DrinkCategories.Soda => new SodaDrinkModel(drinkType, alcoholContent),
         _ => throw new NotImplementedException("Drink category does not exist in the factory!")
     });
Beispiel #2
0
 private void SodaCategorySelected()
 {
     _selectedDrinkCategory          = DrinkCategories.Soda;
     ComboBox_DrinkTypes.ItemsSource = _sodaTypes;
 }
Beispiel #3
0
 private void JuiceCategorySelected()
 {
     _selectedDrinkCategory          = DrinkCategories.Juice;
     ComboBox_DrinkTypes.ItemsSource = _juiceTypes;
 }
Beispiel #4
0
 private void AlcoholicCategorySelected()
 {
     _selectedDrinkCategory          = DrinkCategories.Alcoholic;
     ComboBox_DrinkTypes.ItemsSource = _alcoholTypes;
 }