예제 #1
0
        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);
        }
예제 #2
0
        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();
        }