예제 #1
0
        static void Main(string[] args)
        {
            EnemyShipFactory factory = new EnemyShipFactory();

            Console.WriteLine("What tipe of ship? ( U / R )");
            var lire = Console.ReadLine();

            factory.MakeEnemyShip(lire);

            DoStuffEnemy(factory.MakeEnemyShip(lire));
        }
예제 #2
0
        static void Main(string[] args)
        {
            EnemyShip enemyShip = null;

            Console.WriteLine("What type of ship? (U / R / B)");
            var enemyShipOption = Console.ReadLine().ToUpper();

            EnemyShipFactory shipFactory = new EnemyShipFactory();

            enemyShip = shipFactory.MakeEnemyShip(enemyShipOption);
            doStuffEnemy(enemyShip);

            Console.ReadKey();
        }
예제 #3
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Enter the type of ship");
            var input = Console.ReadLine();

            var factory = new EnemyShipFactory();

            var ship = factory.MakeEnemyShip(input);

            if (ship != null)
            {
                DoStuff(ship);
            }
            else
            {
                Console.WriteLine("Invalid input!");
            }
        }