static void Main(string[] args) { BaseballPlayer dude = new BaseballPlayer(); WoodenBat woodenBat = new WoodenBat(); AluminumBat alum = new AluminumBat(); dude.TakeTurn(woodenBat); dude.TakeTurn(alum); }
static void Main(string[] args) { var woodenBat = new WoodenBat(); var aluminumBat = new AluminumBat(); var compositeBat = new CompositeBat(); var hank = new BaseballPlayer(); IPlayer tom = new CricketPlayer(); tom = new BaseballPlayer(); hank.TakeTurn(woodenBat); hank.TakeTurn(aluminumBat); hank.TakeTurn(compositeBat); tom.TakeTurn(woodenBat); tom.TakeTurn(aluminumBat); tom.TakeTurn(compositeBat); }
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(); }