forked from vagabond-systems/forage-lyft-starter-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
car_factory.py
50 lines (44 loc) · 2.14 KB
/
car_factory.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from battery.nubbin_battery import NubbinBattery
from battery.spindler_battery import SpindlerBattery
from car import Car
from engine.capulet_engine import CapuletEngine
from engine.sternman_engine import SternmanEngine
from engine.willoughby_engine import WilloughbyEngine
from tires.carrigan_tires import CarriganTires
from tires.octoprime_tires import OctoprimeTires
class CarFactory:
@staticmethod
def create_calliope(current_date, last_service_date, current_mileage, last_service_mileage, tire_wear):
engine = CapuletEngine(current_mileage, last_service_mileage)
battery = SpindlerBattery(current_date, last_service_date)
tires = CarriganTires(tire_wear)
car = Car(engine, battery, tires)
return car
@staticmethod
def create_glissade(current_date, last_service_date, current_mileage, last_service_mileage, tire_wear):
engine = WilloughbyEngine(current_mileage, last_service_mileage)
battery = SpindlerBattery(current_date, last_service_date)
tires = OctoprimeTires(tire_wear)
car = Car(engine, battery, tires)
return car
@staticmethod
def create_palindrome(current_date, last_service_date, warning_light_is_on, tire_wear):
engine = SternmanEngine(warning_light_is_on)
battery = SpindlerBattery(current_date, last_service_date)
tires = CarriganTires(tire_wear)
car = Car(engine, battery, tires)
return car
@staticmethod
def create_rorschach(current_date, last_service_date, current_mileage, last_service_mileage, tire_wear):
engine = WilloughbyEngine(current_mileage, last_service_mileage)
battery = NubbinBattery(current_date, last_service_date)
tires = OctoprimeTires(tire_wear)
car = Car(engine, battery, tires)
return car
@staticmethod
def create_thovex(current_date, last_service_date, current_mileage, last_service_mileage, tire_wear):
engine = CapuletEngine(current_mileage, last_service_mileage)
battery = NubbinBattery(current_date, last_service_date)
tires = CarriganTires(tire_wear)
car = Car(engine, battery, tires)
return car