public override string Execute(IResourcesController resController, params string[] commandParams)
        {
            var requirement = ManagementRequirementFactory.CreateRequirement(commandParams);

            resController.ChangeManagementRequirement(requirement);
            return("Management requirement changed!");
        }
示例#2
0
 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!");
        }
示例#4
0
 public CommandExecutor(IResourcesController resController)
 {
     this.resController = resController;
 }
示例#5
0
        public override string Execute(IResourcesController resController, params string[] commandParams)
        {
            Environment.Exit(0);

            return(null);
        }
示例#6
0
        public override string Execute(IResourcesController resController, params string[] commandParams)
        {
            var result = resController.PrintRecyclingStationStatus();

            return(result);
        }
示例#7
0
 public abstract string Execute(IResourcesController resController, params string[] commandParams);