summer_course_2024/physics/physics_factory.py
2020-05-19 17:19:14 -04:00

28 lines
715 B
Python

from physics.physics_feeders.us_new_york_city_physics_parameters import UsNewYorkCityPhysicsParameters
from physics.physics_feeders.us_physics_parameters import UsPhysicsParameters
class PhysicsFactory:
def __init__(self, handler, city):
self._handler = handler.lower().replace(' ', '_')
self._city = city
self.factory()
#samples
def us_new_york_city(self):
UsNewYorkCityPhysicsParameters(self._city)
def us(self):
UsPhysicsParameters(self._city)
def ca(self):
raise Exception('Not implemented')
def de(self):
raise Exception('Not implemented')
def es(self):
raise Exception('Not implemented')
def factory(self):
getattr(self, self._handler, lambda: None)()