コード例 #1
0
        public void SetCakeType(string Name)
        {
            CakeBase cb = getCakeBaseByName(Name);

            if (currentCake == null)
            {
                if (!(cb is ToppingBase))
                {
                    currentCake = cb.Copy();
                }
            }
        }
コード例 #2
0
        public void AddToppingBase(string Name)
        {
            Console.WriteLine(Name);
            CakeBase cb = getCakeBaseByName(Name);

            if (cb != null)
            {
                if (currentCake != null)
                {
                    if (cb is ToppingBase)
                    {
                        CakeBase cbCopy = cb.Copy();
                        ((ToppingBase)cbCopy).NextBase = currentCake.Copy();
                        currentCake = cbCopy;
                    }
                }
            }
        }