示例#1
0
        static void Main(string[] args)
        {
            var woodenBat   = new WoodenBat();
            var aluminumBat = new AluminumBat();
            //var hank = new BaseballPlayer();
            var compositeBat = new CompositeBat();
            var jack         = new CricketPlayer();

            //hank.TakeTurn(woodenBat);
            //hank.TakeTurn(aluminumBat);
            //hank.TakeTurn(compositeBat);
            jack.TakeTurn(woodenBat);
            jack.TakeTurn(aluminumBat);
            jack.TakeTurn(compositeBat);
        }
示例#2
0
        static void Main(string[] args)
        {
            BaseballPlayer hank         = new BaseballPlayer();
            CricketPlayer  courtney     = new CricketPlayer();
            WoodenBat      woodenBat    = new WoodenBat();
            AluminumBat    aluminumBat  = new AluminumBat();
            CompositeBat   compositeBat = new CompositeBat();
            CricketBat     cricketBat   = new CricketBat();

            hank.TakeTurn(woodenBat);
            hank.TakeTurn(aluminumBat);
            hank.TakeTurn(compositeBat);

            Console.WriteLine();

            courtney.TakeTurn(cricketBat);

            Console.WriteLine();
        }