public CoffeeFlavor GetCoffeeFlavor(string flavorName) {
			CoffeeFlavor flavor;
			if (this._flavors.TryGetValue(flavorName, out flavor)) {
				return flavor;
			}
			flavor = new CoffeeFlavor(flavorName);
			this._flavors.Add(flavorName, flavor);
			return flavor;
		}
示例#2
0
        public CoffeeFlavor GetCoffeeFlavor(string flavorName)
        {
            if (!flavors.TryGetValue(flavorName, out CoffeeFlavor flavor))
            {
                flavor = new CoffeeFlavor(flavorName);
                flavors.Add(flavorName, flavor);
            }

            return(flavor);
        }
示例#3
0
        public CoffeeFlavor GetCoffeeFlavor(string flavorName)
        {
            CoffeeFlavor flavor;

            if (this._flavors.TryGetValue(flavorName, out flavor))
            {
                return(flavor);
            }
            flavor = new CoffeeFlavor(flavorName);
            this._flavors.Add(flavorName, flavor);
            return(flavor);
        }