public void AddACanOf(Flavor FlavorOfCanToBeAdded) { if (rack.ContainsKey(FlavorOfCanToBeAdded)) //Check to see if they flavor object exists in the rack dictionary object { FlavorOfCanToBeAdded.ToString(); } AddACanOf(FlavorOfCanToBeAdded.ToString()); }
/// <summary> /// Returns the string representation of this object /// </summary> /// <returns>The string describing the Jerked Soda/returns> public override string ToString() { string s = Size.ToString() + " "; string flavor = Flavor.ToString(); if (flavor.Equals("CreamSoda")) { return(s + "Cream Soda Jerked Soda"); } else if (flavor.Equals("OrangeSoda")) { return(s + "Orange Soda Jerked Soda"); } else if (flavor.Equals("Sarsparilla")) { return(s + "Sarsparilla Jerked Soda"); } else if (flavor.Equals("BirchBeer")) { return(s + "Birch Beer Jerked Soda"); } else { return(s + "Root Beer Jerked Soda"); } }
/// <summary> /// returns the string representation of the Drink /// </summary> /// <returns>returns Jerked Soda string</returns> public override string ToString() { string a = Flavor.ToString(); string b = Size.ToString(); if (a == "CreamSoda") { return(b + " Cream Soda Jerked Soda"); } else if (a == "OrangeSoda") { return(b + " Orange Soda Jerked Soda"); } else if (a == "Sarsparilla") { return(b + " Sarsparilla Jerked Soda"); } else if (a == "BirchBeer") { return(b + " Birch Beer Jerked Soda"); } else { return(b + " Root Beer Jerked Soda"); } }
public void RemoveCan() { if (!IsEmpty) { Quantity--; } Debug.WriteLine($"Bin.RemoveCan was called for flavor {Flavor.ToString()}, New Qty = {Quantity}."); }
public void FillBin() { while (!IsFull) { AddCan(); } Debug.WriteLine($"Bin.FillBin was called for flavor {Flavor.ToString()}, New Qty = {Quantity}."); }
public void EmptyBin() { while (!IsEmpty) { RemoveCan(); } Debug.WriteLine($"Bin.EmptyBin was called for flavor {Flavor.ToString()}, New Qty = {Quantity}."); }
// Methods public void AddCan() { if (!IsFull) { Quantity++; } Debug.WriteLine($"Bin.AddCan was called for flavor {Flavor.ToString()}, New Qty = {Quantity}."); }
/// <remarks> /// Method <c>ToString</c> generates view of pizza table. /// Method takes parameter <c>yournick</c> type of string which is current Name of player /// </remarks> /// <param Name="yourNick"></param> /// <returns> /// The returned value is string representation of Pizza view. /// </returns> public string ToString(string yourNick) { StringBuilder builder = new StringBuilder(); int entireLength = 30; builder.Append(new string('-', entireLength)).Append("\n"); int spaceLength = entireLength - "|".Length - "|".Length - yourNick.Length; int leftSpaceLength; int rightSpaceLength; if (spaceLength % 2 == 0) { int result = spaceLength / 2; leftSpaceLength = result; rightSpaceLength = result; } else { int result = (spaceLength - 1) / 2; leftSpaceLength = result; rightSpaceLength = result + 1; } builder.Append("|") .Append(new string(' ', leftSpaceLength)) .Append(yourNick) .Append(new string(' ', rightSpaceLength)) .Append("|").Append("\n"); builder.Append(new string('-', entireLength)).Append("\n"); builder.Append("|").Append(new string(' ', entireLength - 2)).Append("|").Append("\n"); ProcessFieldsToTable(entireLength, "Pizza", Name.ToString(), builder); builder.Append("|").Append(new string(' ', entireLength - 2)).Append("|").Append("\n"); ProcessFieldsToTable(entireLength, "Hunger", Hunger.ToString(), builder); ProcessFieldsToTable(entireLength, "Sharpness", Sharpness.ToString(), builder); ProcessFieldsToTable(entireLength, "Flavor", Flavor.ToString(), builder); ProcessFieldsToTable(entireLength, "Smell", Smell.ToString(), builder); builder.Append("|").Append(new string(' ', entireLength - 2)).Append("|").Append("\n"); ProcessFieldsToTable(entireLength, "Shape", Shape.ToString(), builder); builder.Append("|").Append(new string(' ', entireLength - 2)).Append("|").Append("\n"); ProcessFieldsToTable(entireLength, "Score", Score.ToString(), builder); builder.Append("|").Append(new string(' ', entireLength - 2)).Append("|").Append("\n"); builder.Append(new string('-', entireLength)).Append("\n"); return(builder.ToString()); }
public void AddACanOf(Flavor flavorName) { Debug.WriteLine($"CanRack.AddACanOf was called for flavor {flavorName.ToString()}."); Bin bin; if (Bins.TryGetValue(flavorName, out bin)) { bin.AddCan(); } else { Debug.WriteLine($"unknown flavor {flavorName}"); } }
/// <summary> /// Returns the size, characteristics, and name of the drink item /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append(Size.ToString() + " "); sb.Append(Flavor.ToString() + " "); sb.Append("Sodasaurus"); return(sb.ToString()); }
/// <summary> /// String that is returned when Jerked Soda is added to order list /// </summary> /// <returns></returns> public override string ToString() { string f; switch (Flavor) { case SodaFlavor.CreamSoda: f = "Cream Soda"; break; case SodaFlavor.OrangeSoda: f = "Orange Soda"; break; case SodaFlavor.Sarsparilla: f = Flavor.ToString(); break; case SodaFlavor.BirchBeer: f = "Birch Beer"; break; case SodaFlavor.RootBeer: f = "Root Beer"; break; default: throw new NotImplementedException(); } switch (Size) { case Size.Small: return("Small " + f + " Jerked Soda"); case Size.Medium: return("Medium " + f + " Jerked Soda"); case Size.Large: return("Large " + f + " Jerked Soda"); default: throw new NotImplementedException(); } }
/// <summary> /// Returns the size, flavor and name of the Jerked Soda /// </summary> /// <returns></returns> public override string ToString() { switch (Flavor) { case SodaFlavor.BirchBeer: return(Size.ToString() + " Birch Beer Jerked Soda"); case SodaFlavor.CreamSoda: return(Size.ToString() + " Cream Soda Jerked Soda"); case SodaFlavor.OrangeSoda: return(Size.ToString() + " Orange Soda Jerked Soda"); case SodaFlavor.RootBeer: return(Size.ToString() + " Root Beer Jerked Soda"); default: return(Size.ToString() + " " + Flavor.ToString() + " Jerked Soda"); } }
/// <summary> /// Adds Jerked Soda to order list /// </summary> /// <returns>name of item</returns> public override string ToString() { if (Flavor == SodaFlavor.BirchBeer) { return(Size.ToString() + " " + "Birch Beer Jerked Soda"); } else if (Flavor == SodaFlavor.CreamSoda) { return(Size.ToString() + " " + "Cream Soda Jerked Soda"); } else if (Flavor == SodaFlavor.OrangeSoda) { return(Size.ToString() + " " + "Orange Soda Jerked Soda"); } else if (Flavor == SodaFlavor.RootBeer) { return(Size.ToString() + " " + "Root Beer Jerked Soda"); } else { return(Size.ToString() + " " + Flavor.ToString() + " Jerked Soda"); } }
public void EmptyCanRackOf(Flavor FlavorOfBinToBeEmptied) { EmptyCanRackOf(FlavorOfBinToBeEmptied.ToString()); }
public void RemoveACanOf(Flavor FlavorOfCanToBeRemoved) { RemoveACanOf(FlavorOfCanToBeRemoved.ToString()); }
public void AddACanOf(Flavor FlavorOfCanToBeAdded) { AddACanOf(FlavorOfCanToBeAdded.ToString()); }
public Boolean IsEmpty(Flavor FlavorOfBinToBeChecked) { return IsEmpty(FlavorOfBinToBeChecked.ToString()); }
public override string ToString() { return("Authentication: " + Flavor.ToString()); }
public Boolean IsEmpty(Flavor FlavorOfBinToBeChecked) { return(IsEmpty(FlavorOfBinToBeChecked.ToString())); }
public Boolean IsEmpty(Flavor CanBinToCheck) { return(IsEmpty(CanBinToCheck.ToString())); }
/// <summary> /// overrides the ToString function to return the size and the item /// </summary> /// <returns>The size and Sodasaurus</returns> public override string ToString() { return($"{size.ToString()} {Flavor.ToString()} Sodasaurus"); }
public Boolean IsEmpty(Flavor CanBinToCheck) { return IsEmpty(CanBinToCheck.ToString()); }
//constructor2 public Scoop(Flavor f) { this.Flavor = f; this.Price = 0.5; this.Name = f.ToString(); }
public Boolean IsFull(Flavor CanBinToCheck) { return(IsFull(CanBinToCheck.ToString())); }
public void EmptyCanRackOf(Flavor FlavorOfCanToBeEmptied) { AddACanOf(FlavorOfCanToBeEmptied.ToString()); }
public Boolean IsFull(Flavor CanBinToCheck) { return IsFull(CanBinToCheck.ToString()); }
public void AddACanOf(Flavor FlavorOfCanToBeAdded) //More advanced method override (that uses Flavor type) simply leans on the backward-compatible version of the method that takes string... { AddACanOf(FlavorOfCanToBeAdded.ToString()); }
/// <summary> /// ToString Method to override ToString /// </summary> /// <returns>a string </returns> public override string ToString() { return(Size.ToString() + " " + Flavor.ToString() + " Sailor Soda"); }
/// <summary> /// Returns the name of the menu item in string format /// </summary> /// <returns>The name of the menu item</returns> public override string ToString() { return(size.ToString() + " " + Flavor.ToString() + " Sodasaurus"); }