public override string Execute(IResourcesController resController, params string[] commandParams) { var requirement = ManagementRequirementFactory.CreateRequirement(commandParams); resController.ChangeManagementRequirement(requirement); return("Management requirement changed!"); }
public Engine(IResourcesDatabase resDatabase) { this.resDatabase = resDatabase; this.strategyholder = new StrategyHolder(); this.garbageProcessor = new GarbageProcessor(this.strategyholder); this.resController = new ResourcesController(this.resDatabase, this.garbageProcessor); this.comExecutor = new CommandExecutor(this.resController); this.consoleReader = new ConsoleReader(); this.consoleWriter = new ConsoleWriter(); this.inputInterpreter = new InputInterpreter(); }
public override string Execute(IResourcesController resController, string[] commandParams) { var name = commandParams[0]; var weight = double.Parse(commandParams[1]); var volumePerKg = double.Parse(commandParams[2]); var garbageType = commandParams[3]; var waste = GarbageFactory.CreateWaste(new object[] { name, weight, volumePerKg }, garbageType); var processingData = resController.ProcessWaste(waste); resController.AddProccessingData(processingData); return($"{weight:f2} kg of {name} successfully processed!"); }
public CommandExecutor(IResourcesController resController) { this.resController = resController; }
public override string Execute(IResourcesController resController, params string[] commandParams) { Environment.Exit(0); return(null); }
public override string Execute(IResourcesController resController, params string[] commandParams) { var result = resController.PrintRecyclingStationStatus(); return(result); }
public abstract string Execute(IResourcesController resController, params string[] commandParams);