Esempio n. 1
0
 public CarConfiguration(IRaceTrack raceTrack, double fuelCapacity, TimeSpan timePerLap, double fuelConsumptionPerLap)
 {
     _raceTrack             = (RaceTrack)raceTrack;
     _fuelCapacity          = fuelCapacity;
     _timePerLap            = timePerLap;
     _fuelConsumptionPerLap = fuelConsumptionPerLap;
     _configurationId       = Guid.NewGuid();
 }
Esempio n. 2
0
 public RaceCar(ICarConfiguration carConfiguration)
 {
     _carConfiguration = carConfiguration;
     _raceTrack        = ((CarConfiguration)carConfiguration).RaceTrack;
     _raceCarId        = Guid.NewGuid();
     _fuelLevel        = _carConfiguration.FuelCapacity;
     _speed            = _raceTrack.LapDistrance / _carConfiguration.TimePerLap.TotalSeconds;
 }