Skip to content

Commit

Permalink
testing read_gym() method after changes
Browse files Browse the repository at this point in the history
  • Loading branch information
EsatGokcen committed Dec 31, 2024
1 parent f7fd2bf commit a21fa99
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,6 @@ def create_gym_data():

gym2.create_class(cardio_class.model)

gym1.read_gym()
gym2.read_gym()
return [gym1, gym2]
3 changes: 3 additions & 0 deletions src/controller/equipment_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ def __init__(self):
self.model = EquipmentModel(name="palceholder", type="placeholder")
self.__view = EquipmentView(self.model)

def __str__(self):
return f"{self.model.get_equipment_name()} for {self.model.get_equipment_type()}"

def create_equipment(self, name: str, type: str) -> EquipmentModel:
self.model.set_equipment_name(name)
self.model.set_equipment_type(type)
Expand Down
4 changes: 3 additions & 1 deletion src/model/gym_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def get_gym_workout_zones(self) -> list[WorkoutZoneModel]:
return self.__workout_zones

def get_equipments_for_workout_zones(self) -> list[EquipmentModel]:
equipment_list = []
for workout_zone in self.__workout_zones:
return workout_zone.get_list_of_equipments()
equipment_list.append(workout_zone.get_list_of_equipments())
return equipment_list # BROKEN

def get_list_of_staff(self) -> list[StaffModel]:
return self.__list_of_staff
Expand Down
2 changes: 1 addition & 1 deletion src/model/workout_zone_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, type: str, capacity: int):
self.__attendant = None

def __str__(self):
return f"\n{self.__type} with capacity: {self.__capacity}. Attendant: {self.__attendant}"
return f"\n{self.__type} with capacity: {self.__capacity}."

def get_workout_zone_type(self) -> str:
return self.__type
Expand Down
2 changes: 1 addition & 1 deletion src/view/gym_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def render(self):

# Gets each workout zone in the list as a string
zones = ", ".join(str(zone) for zone in workout_zones)
equipments = ", ".join(str(equipment) for equipment in equipments_list)
equipments = "\n".join(str(equipment) for equipment in equipments_list)
staffs = ", ".join(str(staff) for staff in staff_list)
members = ", ".join(str(member) for member in members_list)
classes = ", ".join(str(clas) for clas in classes_list)
Expand Down

0 comments on commit a21fa99

Please sign in to comment.