Ejemplo n.º 1
0
        public void RegisterDriver(List <string> commandArgs)
        {
            ITyre   tyre   = tyreFactory.Produce(commandArgs);
            ICar    car    = carFactory.Produce(commandArgs, tyre);
            IDriver driver = driverFactory.Produce(commandArgs, car, this.lengthOfLap);

            if (tyre == null || car == null || driver == null)
            {
                throw new ArgumentException("Invalid arguments for registering driver");
            }
            this.drivers.Add(driver);
        }