Example #1
0
        static void Main(string[] args)
        {
            string avoid;

            EnemyShip theEnemy = null;

            EnemyshipFactory shipFactory = new EnemyshipFactory();

            Console.WriteLine("What type of ship? (U/R/B)");
            string userInput = Console.ReadLine();

            theEnemy = shipFactory.makeEnemyShip(userInput);


            if (theEnemy != null)
            {
                doStuffEnemy(theEnemy);
            }
            else
            {
                Console.WriteLine("the enemy is null");
            }

            avoid = Console.ReadLine();
        }
Example #2
0
 public static void doStuffEnemy(EnemyShip anEnemyShip)
 {
     anEnemyShip.displayEnemyShip();
     anEnemyShip.followHeroShip();
     anEnemyShip.enemyShipShoots();
 }