Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/MaterialManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,30 @@ def __init__(self, params: list):
self.params = params
# other configurations

def changeMaterial(self, material) -> bool:
def changeMaterial(self, material) -> bool:
returnText = ""
textBaseForValidMaterial = "Material is changed to"

match material:
case materialType.Titanium:
self.carManager.setMaterial(materialType.Titanium)
returnText = "Material is changed to Titanium."
returnText = f"{textBaseForValidMaterial} Titanium."

case materialType.Carbon:
self.carManager.setMaterial(materialType.Carbon)
returnText = "Material is changed to Carbon."
returnText = f"{textBaseForValidMaterial} Carbon."

case materialType.AlloyX:
self.carManager.setMaterial(materialType.AlloyX)
returnText = f"{textBaseForValidMaterial} AlloyX."

case _:
returnText = "Material seletion is invalid."
returnText = "Material selection is invalid."

return self._announceMaterial(returnText)




def _announceMaterial(self, text: str) -> bool:
return self.announcer(text)
7 changes: 6 additions & 1 deletion src/Util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from enum import Enum

materialType = Enum('Titanium', 'Carbon')
<<<<<<< HEAD
# vibranium is specific to Steve's car
materialType = Enum('Titanium', 'Carbon', 'Vibranium')
=======
materialType = Enum('Titanium', 'Carbon', 'AlloyX')
>>>>>>> bruce-alloyX