private static IWorker SelectWorker(string need) { IWorker worker = null; if (need == "Chippy" || need == "Carpenter") { //simulating work worker = new Chippy(); worker.name = "HelpfulHarry"; } if (need == "Plumby" || need == "Plumber") { //simulating work worker = new Plumby(); worker.name = "HelpfulHarry"; } if (need == "Sparky" || need == "Electrition") { //simulating work worker = new Sparky(); worker.name = "HelpfulHarry"; } return(worker); }
private static Worker ChoiceOfWorker(string choice) { Worker worker = new Worker(); if (choice == "Chippy" || choice == "Carpenter") { worker = new Plumby(); } if (choice == "Plumby" || choice == "Plumber") { worker = new Plumby(); } if (choice == "Sparky" || choice == "Electrition") { worker = new Plumby(); } return(worker); }