public EnemyShip MakeEnemyShip(EnemyShipEnum shipType) { EnemyShip shipChosen = null; switch (shipType) { case EnemyShipEnum.UFOEnemyShip: shipChosen = new UFOEnemyShip(); break; case EnemyShipEnum.RocketEnemyShip: shipChosen = new RocketEnemyShip(); break; case EnemyShipEnum.BigUFOEnemyShip: shipChosen = new BigUFOEnemyShip(); break; default: shipChosen = null; break; } return(shipChosen); }
public EnemyShip MakeEnemyShip(string newShipType) { EnemyShip newShip = null; if (newShipType.Equals("U")) { newShip = new UFOEnemyShip(); } else if (newShipType.Equals("R")) { newShip = new RocketEnemyShip(); } else if (newShipType.Equals("B")) { newShip = new BigUFOEnemyShip(); } return(newShip); }
public EnemyShip makeEnemyShip(string newShipType) { EnemyShip newShip = null; switch (newShipType) { case "U": newShip = new UFOEnemyShip(); break; case "R": newShip = new RocketEnemyShip(); break; case "B": newShip = new BigUFOEnemyShip(); break; default: break; } return(newShip); }