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());
        }
Esempio n. 2
0
        /// <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");
            }
        }
Esempio n. 3
0
        /// <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");
            }
        }
Esempio n. 4
0
 public void RemoveCan()
 {
     if (!IsEmpty)
     {
         Quantity--;
     }
     Debug.WriteLine($"Bin.RemoveCan was called for flavor {Flavor.ToString()}, New Qty = {Quantity}.");
 }
Esempio n. 5
0
 public void FillBin()
 {
     while (!IsFull)
     {
         AddCan();
     }
     Debug.WriteLine($"Bin.FillBin was called for flavor {Flavor.ToString()}, New Qty = {Quantity}.");
 }
Esempio n. 6
0
 public void EmptyBin()
 {
     while (!IsEmpty)
     {
         RemoveCan();
     }
     Debug.WriteLine($"Bin.EmptyBin was called for flavor {Flavor.ToString()}, New Qty = {Quantity}.");
 }
Esempio n. 7
0
 // Methods
 public void AddCan()
 {
     if (!IsFull)
     {
         Quantity++;
     }
     Debug.WriteLine($"Bin.AddCan was called for flavor {Flavor.ToString()}, New Qty = {Quantity}.");
 }
Esempio n. 8
0
        /// <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}");
     }
 }
Esempio n. 10
0
        /// <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());
        }
Esempio n. 11
0
        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}");
            }
        }
Esempio n. 12
0
        /// <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();
            }
        }
Esempio n. 13
0
        /// <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");
            }
        }
Esempio n. 14
0
 /// <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");
     }
 }
Esempio n. 15
0
 public void EmptyCanRackOf(Flavor FlavorOfBinToBeEmptied)
 {
     EmptyCanRackOf(FlavorOfBinToBeEmptied.ToString());
 }
Esempio n. 16
0
 public void RemoveACanOf(Flavor FlavorOfCanToBeRemoved)
 {
     RemoveACanOf(FlavorOfCanToBeRemoved.ToString());
 }
Esempio n. 17
0
 public void AddACanOf(Flavor FlavorOfCanToBeAdded)
 {
     AddACanOf(FlavorOfCanToBeAdded.ToString());
 }
Esempio n. 18
0
 public Boolean IsEmpty(Flavor FlavorOfBinToBeChecked)
 {
     return IsEmpty(FlavorOfBinToBeChecked.ToString());
 }
Esempio n. 19
0
 public override string ToString()
 {
     return("Authentication: " + Flavor.ToString());
 }
Esempio n. 20
0
 public void RemoveACanOf(Flavor FlavorOfCanToBeRemoved)
 {
     RemoveACanOf(FlavorOfCanToBeRemoved.ToString());
 }
Esempio n. 21
0
 public Boolean IsEmpty(Flavor FlavorOfBinToBeChecked)
 {
     return(IsEmpty(FlavorOfBinToBeChecked.ToString()));
 }
 public Boolean IsEmpty(Flavor CanBinToCheck)
 {
     return(IsEmpty(CanBinToCheck.ToString()));
 }
Esempio n. 23
0
 /// <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");
 }
Esempio n. 24
0
 public Boolean IsEmpty(Flavor CanBinToCheck)
 {
     return IsEmpty(CanBinToCheck.ToString());
 }
Esempio n. 25
0
 //constructor2
 public Scoop(Flavor f)
 {
     this.Flavor = f;
     this.Price = 0.5;
     this.Name = f.ToString();
 }
Esempio n. 26
0
 public Boolean IsFull(Flavor CanBinToCheck)
 {
     return(IsFull(CanBinToCheck.ToString()));
 }
Esempio n. 27
0
 public void EmptyCanRackOf(Flavor FlavorOfCanToBeEmptied)
 {
     AddACanOf(FlavorOfCanToBeEmptied.ToString());
 }
Esempio n. 28
0
 public void AddACanOf(Flavor FlavorOfCanToBeAdded)
 {
     AddACanOf(FlavorOfCanToBeAdded.ToString());
 }
Esempio n. 29
0
 public Boolean IsFull(Flavor CanBinToCheck)
 {
     return IsFull(CanBinToCheck.ToString());
 }
Esempio n. 30
0
 public void EmptyCanRackOf(Flavor FlavorOfBinToBeEmptied)
 {
     EmptyCanRackOf(FlavorOfBinToBeEmptied.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());
 }
Esempio n. 32
0
 /// <summary>
 /// ToString Method to override ToString
 /// </summary>
 /// <returns>a string </returns>
 public override string ToString()
 {
     return(Size.ToString() + " " + Flavor.ToString() + " Sailor Soda");
 }
Esempio n. 33
0
 /// <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");
 }