private void SetDescription()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(base.DrinkType.ToString() + ", ");
            builder.Append(base.IsCarbonated ? "carbonated" : "not carbonated");

            if (FruitTypes.Count > 0)
            {
                builder.Append(", ");
                builder.Append(FruitTypes.Count > 0 ? "made from " + string.Join(", ", FruitTypes.ToArray()) : string.Empty);
            }

            if (IsAlcoholic)
            {
                builder.Append(", ");
                builder.Append(base.IsAlcoholic ? AlcoholContent.ToString() + "%. " : ". ");
            }
            else
            {
                builder.Append(".");
            }

            base.Description = builder.ToString();
        }
示例#2
0
        private void SetDescription()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(base.DrinkType.ToString() + ", ");
            builder.Append(base.IsCarbonated ? "carbonated, " : "not carbonated, ");
            builder.Append(base.IsAlcoholic ? AlcoholContent.ToString() + "%. " : "0%. ");

            base.Description = builder.ToString();
        }
示例#3
0
        public override Dictionary <string, string> GetDrinkInfo()
        {
            var drinkInfo = new Dictionary <string, string>
            {
                { "Name", Name },
                { "Cost", Cost.ToString() },
                { "Alcohol content", AlcoholContent.ToString() },
                { "Date of bottling", DateOfBottling.ToString() },
                { "Grape sort", GrapeSort },
                { "Vines age", VinesAge.ToString() },
                { "Bottle volume", Bottle.Volume.ToString() },
                { "Bottle color", Bottle.Color }
            };

            return(drinkInfo);
        }
示例#4
0
        public override Dictionary <string, string> GetDrinkInfo()
        {
            var drinkInfo = new Dictionary <string, string>
            {
                { "Name", Name },
                { "Cost", Cost.ToString() },
                { "Alcohol content", AlcoholContent.ToString() },
                { "Date of bottling", DateOfBottling.ToString() },
                { "Class", Class },
                { "Barrel material", BarrelMaterial },
                { "Bottle volume", Bottle.Volume.ToString() },
                { "Bottle color", Bottle.Color }
            };

            return(drinkInfo);
        }
示例#5
0
        private void SetDescription()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(base.DrinkType.ToString() + ", ");
            builder.Append(base.IsCarbonated ? "carbonated" : "not carbonated");

            if (IsAlcoholic)
            {
                builder.Append(", ");
                builder.Append(AlcoholContent.ToString() + "%. ");
            }
            else
            {
                builder.Append(".");
            }

            base.Description = builder.ToString();
        }