public string RegisterHarvester(List <string> arguments)
 {
     try
     {
         var harvester = HarvesterFactory.CreateHarvest(arguments);
         this.Harvesters[arguments[1]] = harvester;
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
     return($"Successfully registered {arguments[0]} Harvester - {arguments[1]}");
 }
Example #2
0
    public string RegisterHarvester(List <string> arguments)
    {
        string type = arguments[0];
        string id   = arguments[1];

        try
        {
            Harvester harvester = HarvesterFactory.CreateHarvest(arguments);
            harvesters.Add(harvester);
        }
        catch (ArgumentException argEx)
        {
            return($"Harvester is not registered, because of it's {argEx.Message}");
        }

        return($"Successfully registered {type} Harvester - {id}");
    }