예제 #1
0
 public void Cook(Potato potato)
 {
     if (this.CheckPotato(potato))
     {
         // perform some potatocooking logic
         potato.IsCooked = true;
     }
 }
예제 #2
0
 public void Cook(Potato potato)
 {
     if (this.CheckPotato(potato))
     {
         // perform some potatocooking logic
         potato.IsCooked = true;
     }
 }
예제 #3
0
        private bool CheckPotato(Potato potato)
        {
            if (potato != null)
            {
                if (potato.IsPeeled && !potato.IsRotten)
                {
                    return true;
                }

                return false;
            }

            return false;
        }
예제 #4
0
        private bool CheckPotato(Potato potato)
        {
            if (potato != null)
            {
                if (potato.IsPeeled && !potato.IsRotten)
                {
                    return(true);
                }

                return(false);
            }

            return(false);
        }
예제 #5
0
        static void Main(string[] args)
        {
            Potato potato = GetPotato();

            if (potato != null)
            {
                if (potato.HasBeenPeeled && !potato.IsRotten)
                {
                    Cook(potato);
                }
            }
            else
            {
                throw new Exception("Potato should not be null!");
            }
        }
예제 #6
0
        public static void Main(string[] args)
        {
            var potato = new Potato();
            var chef   = new Chef();

            try
            {
                var meal = CookingIf.ProcessVegetable(potato, chef);
                Console.WriteLine(meal);
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e.Message);
            }

            MatrixIf.VisitCell(5, 5);
        }
예제 #7
0
 private static void Cook(Potato potato)
 {
     throw new System.NotImplementedException();
 }