private static void Main(string[] args) { EnemyShipBuilding <ShipType> MakeUfos = new UFOEnemyShipBuilding(); EnemyShip theGrunt = MakeUfos.orderTheShip(ShipType.Ufo); Console.WriteLine(theGrunt.Name); EnemyShip theBoss = MakeUfos.orderTheShip(ShipType.UfoBoss); Console.WriteLine(theBoss.Name); }
static void Main() { // EnemyShipBuilding handles orders for new EnemyShips // You send it a code using the orderTheShip method & // it sends the order to the right factory for creation EnemyShipBuilding MakeUFOs = new UFOEnemyShipBuilding(); EnemyShip theGrunt = MakeUFOs.orderTheShip("UFO"); Console.WriteLine(theGrunt + "\n"); EnemyShip theBoss = MakeUFOs.orderTheShip("UFO BOSS"); Console.WriteLine(theBoss + "\n"); Console.ReadLine(); }