Beispiel #1
0
        public string Charge(string robotName, int procedureTime)
        {
            var robot = garage.Robots.GetValueOrDefault(robotName);

            if (robot == null)
            {
                throw new ArgumentException($"Robot {robotName} does not exist");
            }
            Models.Procedures.Contracts.Procedure procedure = this.charge;
            procedure.DoService(robot, procedureTime);
            procedures.Add(procedure);
            return($"{robotName} had charge procedure");
        }
Beispiel #2
0
        public string Work(string robotName, int procedureTime)
        {
            var robot = garage.Robots.GetValueOrDefault(robotName);

            if (robot == null)
            {
                throw new ArgumentException($"Robot {robotName} does not exist");
            }

            Models.Procedures.Contracts.Procedure procedure = this.work;
            procedure.DoService(robot, procedureTime);
            procedures.Add(procedure);
            return($"{robotName} was working for {procedureTime} hours.");
        }