Example #1
0
 /**
  * @param Car $car
  * @return PlayerCar
  */
 public function provideStockCar(Car $car)
 {
     $partProvider = $this->partProvider;
     $stockCar = new PlayerCar();
     $stockCar->setCar($car);
     $stockCar->setAspirationPart($partProvider->getAspirationPart($car->getAspiration(), PartLevels::STOCK));
     $stockCar->setBrakes($partProvider->getPart(PartTypeNames::BRAKES, PartLevels::STOCK));
     $stockCar->setDrivetrainPart($partProvider->getDrivetrainPart($car->getDrivetrain(), PartLevels::STOCK));
     $stockCar->setEngineTune($partProvider->getPart(PartTypeNames::ENGINE_TUNE, PartLevels::STOCK));
     $stockCar->setMassReduction($partProvider->getPart(PartTypeNames::MASS_REDUCTION, PartLevels::STOCK));
     $stockCar->setSuspension($partProvider->getPart(PartTypeNames::SUSPENSION, PartLevels::STOCK));
     return $stockCar;
 }
 private function getRandomPlayerCar()
 {
     $playerCar = new PlayerCar();
     return $playerCar->setCar($this->getRandomCar());
 }