public override int GetHashCode() => BreadType.GetHashCode() ^ CheeseType.GetHashCode() ^ HasMayo.GetHashCode() ^ HasMustard.GetHashCode() ^ IsToasted.GetHashCode() ^ MeatType.GetHashCode() ^ Vegetables.GetHashCode();
public Bread(BreadType type) { switch (type) { case BreadType.Beyaz: this.Price = 1.0; this.Gram = Gramaj.Yuz; break; case BreadType.Kepek: this.Price = 1.0; this.Gram = Gramaj.Yuz; break; case BreadType.Bugday: this.Price = 1.0; this.Gram = Gramaj.Yuz; break; case BreadType.Odun: this.Price = 2.0; this.Gram = Gramaj.IkiYuz; break; case BreadType.AltinEkmek: this.Price = 1.5; this.Gram = Gramaj.YuzYirmiBes; break; default: break; } }
/// /// This methods adds a new sandwich. The name of the sandwich must be unique. /// When this is not the case, the method should return false and the sandwich /// will not be added. Otherwhises, the method return true and the sandwich is /// added to the list of sandwiches. /// private void btAddBread_Click(object sender, EventArgs e) { try { string name; if (string.IsNullOrWhiteSpace(removeWhiteSpaces(name = this.tbName.Text.ToString()))) { MessageBox.Show("Change the Name field"); } else { if (this.cbBreadTypes.SelectedIndex > -1) { BreadType breadType = (BreadType)this.cbBreadTypes.SelectedItem; Bread bread = new Bread("description", breadType, 2.00); this.sandwich = new Sandwich(name, bread); MessageBox.Show("You successfully added a sandwitch!"); } else { MessageBox.Show("Please, select from the combobox!"); } } } catch (Exception) { System.Console.WriteLine("Input sandwitch"); throw; } }
public void PrepareRecipe(BreadType breadType, CheeseType cheeseType) { _sandwichRecipe.ChooseBread(breadType); _sandwichRecipe.AddProtein(); _sandwichRecipe.AddCheese(cheeseType); _sandwichRecipe.AddVegetables(); _sandwichRecipe.AddSauces(); }
public Sandwich(BreadType bread, CheeseType cheese, bool hasMayo, bool istoasted, bool HasMustard, List <string> vegetables) { this.Bread = bread; this.Cheese = cheese; this.HasMayo = hasMayo; this.IsToasted = IsToasted; this.HasMustard = HasMustard; this.Vegetables = vegetables; }
public Sandwich(BreadType bread, CheeseType cheese, bool hasMayo, bool istoasted, bool HasMustard, List<string> vegetables) { this.Bread = bread; this.Cheese = cheese; this.HasMayo = hasMayo; this.IsToasted = IsToasted; this.HasMustard = HasMustard; this.Vegetables = vegetables; }
public Sandwich(BreadType breadType, bool isToasted, CheeseType cheeseType, MeatType meatType, bool hasMustard, bool hasMayo, List <string> vegetables) { BreadType = breadType; IsToasted = isToasted; CheeseType = cheeseType; MeatType = meatType; HasMustard = hasMustard; HasMayo = hasMayo; Vegetables = vegetables; }
public Sandwich1(BreadType breadType, bool isToasted, CheesType cheesType, MeatType meatType, bool hasMustard, bool hasMayo, List <string> vegetables) { this.breadType = breadType; this.isToasted = isToasted; this.cheesType = cheesType; this.meatType = meatType; this.hasMustard = hasMustard; this.hasMayo = hasMayo; this.vegetables = vegetables; }
public Sandwich(BreadType breadType, bool isToasted, CheeseType cheeseType, MeatType meatType, bool hasMustard, bool hasMayo, List <string> vegetables) { _breadType = breadType; _isToasted = isToasted; _cheeseType = cheeseType; _meatType = meatType; _hasMustard = hasMustard; _hasMayo = hasMayo; _vegetables = vegetables; }
public Sandwich_Original(BreadType breadType, bool isToasted, CheeseType cheeseType, MeatType meatType, bool hasMustard, bool hasMayo, List <string> vegetables) { _BreadType = breadType; _IsToasted = isToasted; _CheeseType = cheeseType; _MeatType = meatType; _HasMustard = hasMustard; _HasMayo = hasMayo; _Vegetables = vegetables; }
public Bread( int id, double price, BreadType type) { switch (type) { case BreadType.White: Price = 1.0; Weight = Weight.Hundred; break; case BreadType.Wheat: Price = 2.0; Weight = Weight.OneHundredTwentyFive; break; case BreadType.WholeGrain: Price = 3.0; Weight = Weight.TwoHundred; break; } }
public static BreadMaker MakeBread(BreadType breadType) { BreadMaker breadMaker = null; switch (breadType) { case BreadType.BlackBread: breadMaker = new BlackBread(); break; case BreadType.HoneyBread: breadMaker = new HoneyBread(); break; case BreadType.WhiteBread: breadMaker = new WhiteBread(); break; case BreadType.HoneyWhiteBread: breadMaker = new HoneyWhiteBread(); break; } return(breadMaker); }
public SandwichRecipeBuilder InBread(BreadType breadType) { _sandwich.Bread = breadType; return(this); }
//smell - possibility of more than one constructor to deal with different possibilities //But hard to know which constructor public Sandwich(BreadType breadType, bool isToasted, CheeseType cheeseType) { BreadType = breadType; IsToasted = isToasted; CheeseType = cheeseType; }
public void setBreadType(BreadType breadType) { this.breadType = breadType; }
public abstract void ChooseBread(BreadType breadType);
public override void ChooseBread(BreadType breadType) { _sandwichRecipe.Bread = breadType; }
public Bread(string name, decimal price, string dealer, Stamp stamp, BreadType breadType = BreadType.White) : base(name, price, dealer, stamp) { this.BreadType = breadType; }
public HamburgerBuilder AddBread(BreadType type) { return(this); }