Beispiel #1
0
        public void FlySpeed(int value)
        {
            if (BirdFlewAway)
            {
                Console.WriteLine("{0} flew away ...", name);
            }
            else
            {
                speed += value;
                if (speed >= arr[3])
                {
                    BirdFlewAway = true;
                    speed        = 0;

                    BirdFlyAwayExeption ex =
                        new BirdFlyAwayExeption(string.Format("{0} flew with incredible speed!", name),
                                                "Oh! Startle.", DateTime.Now);
                    ex.HelpLink = "http://en.wikipedia.org/wiki/Tufted_titmouse";

                    throw ex;
                }
                else
                {
                    Console.WriteLine("... flying close with the speed = {0}", speed);
                }
            }
        }
Beispiel #2
0
        public void FlySpeed(int value)
        {
            if (BirdFlewAway)
                Console.WriteLine("{0} flew away ...", name);
            else
            {
                speed += value;
                if (speed >= arr[3])
                {
                    BirdFlewAway = true;
                    speed = 0;

                   BirdFlyAwayExeption ex =
                        new BirdFlyAwayExeption(string.Format("{0} flew with incredible speed!", name),
                                               "Oh! Startle.", DateTime.Now);
                    ex.HelpLink = "http://en.wikipedia.org/wiki/Tufted_titmouse";

                    throw ex;
                }
                else
                    Console.WriteLine("... flying close with the speed = {0}", speed);
            }
        }