public static Engine MakeEngine(string engineType) { Engine engine; switch (engineType) { case "Gasoline": engine = new GasolineEngine(); break; case "Solar": engine = new SolarEngine(); break; default: return null; break; } return engine; }
public static Engine MakeEngine(string engineType) { Engine engine; switch (engineType) { case "Gasoline": engine = new GasolineEngine(); break; case "Solar": engine = new SolarEngine(); break; default: return(null); break; } return(engine); }