public string TechCheck(string robotName, int procedureTime) { RobotExist(robotName); //throws exception if doesn't exist techCheck = new TechCheck(); techCheck.DoService(GetRobotByName(robotName), procedureTime); return($"{robotName} had tech check procedure"); }
public string TechCheck(string robotName, int procedureTime) { isRobotExist(robotName); Procedure procedure = new TechCheck(); var currentRobot = garage.Robots[robotName]; procedure.DoService(currentRobot, procedureTime); return($"{currentRobot.Name} had tech check procedure"); }
public string TechCheck(string robotName, int procedureTime) { IRobot robot = GetRobotToDoProcedure(robotName); Procedure procedure = new TechCheck(); procedure.DoService(robot, procedureTime); AddProcedureToRobot(robotName, procedureTime, procedure); return(String.Format(OutputMessages.TechCheckProcedure, robot.Name)); }
public Controller() { garage = new Garage(); chip = new Chip(); techCheck = new TechCheck(); rest = new Rest(); work = new Work(); charge = new Charge(); polish = new Polish(); }
public Controller() { this.polish = new Polish(); this.charge = new Charge(); this.work = new Work(); this.rest = new Rest(); this.garage = new Garage(); this.chip = new Chip(); this.techCheck = new TechCheck(); }
public string TechCheck(string robotName, int procedureTime) { var currentRobot = RobotExistsInGarage(robotName); IProcedure techCheck = new TechCheck(); techCheck.DoService(currentRobot, procedureTime); AddProcedure(techCheck, currentRobot); return(String.Format(OutputMessages.TechCheckProcedure, currentRobot.Name)); }
public string TechCheck(string robotName, int procedureTime) { DoesRobotExists(robotName); var robot = garage.Robots.Values.FirstOrDefault(r => r.Name == robotName); TechCheck techCheck = new TechCheck(); techCheck.DoService(robot, procedureTime); return($"{robotName} had tech check procedure"); }
public Controller() { this._polish = new Polish(); this._chip = new Chip(); this._techCheck = new TechCheck(); this._work = new Work(); this._charge = new Charge(); this._rest = new Rest(); this._allProcedures = new List <IProcedure>(); this._garage = new Garage(); }
public string TechCheck(string robotName, int procedureTime) { IRobot robot = GetRobot(robotName); IProcedure procedure = _procedures.FirstOrDefault(p => p.GetType().Name == nameof(TechCheck)); if (procedure == null) { procedure = new TechCheck(); } procedure.DoService(robot, procedureTime); _procedures.Add(procedure); return(string.Format(OutputMessages.TechCheckProcedure, robotName)); }
public string TechCheck(string robotName, int procedureTime) { CheckThatRobotExistInGarage(robotName); IRobot currentRobot = this.garage.Robots[robotName]; var procedure = this.procedures.FirstOrDefault(p => p.GetType().Name == "TechCheck"); if (procedure == null) { procedure = new TechCheck(); } procedure.DoService(currentRobot, procedureTime); this.procedures.Add(procedure); return($"{robotName} had tech check procedure"); }
public Controller() { this.garage = new Garage(); this.charge = new Charge(); this.chip = new Chip(); this.polish = new Polish(); this.rest = new Rest(); this.techCheck = new TechCheck(); this.work = new Work(); this.procedures = new List <IProcedure>() { this.charge, this.chip, this.polish, this.rest, this.techCheck, this.work }; }
private void SeedProcedures() { foreach (var p in Assembly.GetAssembly(typeof(Procedure)).GetTypes() .Where(ty => ty.IsSubclassOf(typeof(Procedure)))) { string name = p.Name.ToLower(); _procedures.Add(name, null); switch (p.Name) { case "Charge": IProcedure charge = new Charge(); _procedures[name] = charge; break; case "Chip": IProcedure chip = new Chip(); _procedures[name] = chip; break; case "Polish": IProcedure polish = new Polish(); _procedures[name] = polish; break; case "Rest": IProcedure rest = new Rest(); _procedures[name] = rest; break; case "TechCheck": IProcedure techCheck = new TechCheck(); _procedures[name] = techCheck; break; case "Work": IProcedure work = new Work(); _procedures[name] = work; break; } } }
public Controller() { this.garage = new Garage(); var chargeProcedure = new Charge(); var chipProcedure = new Chip(); var polishProcedure = new Polish(); var restProcedure = new Rest(); var techProcedure = new TechCheck(); var workProcedure = new Work(); this.procedures = new List <IProcedure>() { chargeProcedure, chipProcedure, polishProcedure, restProcedure, techProcedure, workProcedure }; }