forked from vagabond-systems/forage-lyft-starter-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
carFactory.py
43 lines (37 loc) · 1.77 KB
/
carFactory.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
from battery.nubbin_battery import NubbinBattery
from battery.spindler_battery import SpindlerBattery
from car import Car
from engine.capulet_engine import CapuletEngine
from sternman_engine import SternmanEngine
from willoughby_engine import WilloughbyEngine
class carFactory: # create different types of car
@staticmethod
def create_calliope(current_date, last_service_date, current_milleage, last_service_mileage):
engine = CapuletEngine(current_milleage, last_service_mileage)
battery = SpindlerBattery(current_date, last_service_date)
car = Car(engine, battery)
return car
@staticmethod
def create_glissade(current_date, last_service_date, current_milleage, last_service_mileage):
engine = WilloughbyEngine(current_milleage, last_service_mileage)
battery = SpindlerBattery(current_date, last_service_date)
car = Car(engine, battery)
return car
@staticmethod
def create_palindrome(current_date, last_service_date, warning_light_is_on):
engine = SternmanEngine(warning_light_is_on)
battery = SpindlerBattery(current_date, last_service_date)
car = Car(engine, battery)
return car
@staticmethod
def create_rorschach(current_date, last_service_date, warning_light_is_on):
engine = WilloughbyEngine(warning_light_is_on)
battery = NubbinBattery(current_date, last_service_date)
car = Car(engine, battery)
return car
@staticmethod
def create_thovex(current_date, last_service_date, current_milleage, last_service_mileage):
engine = CapuletEngine(current_milleage, last_service_mileage)
battery = NubbinBattery(current_date, last_service_date)
car = Car(engine, battery)
return car