-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C16MapleFaithKauweSwap-MeetFinal #73
base: master
Are you sure you want to change the base?
Conversation
self.category = category | ||
self.condition = condition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use inheritance here by invoking super()
self.category = category | |
self.condition = condition | |
super().__init__(category="Clothing",condition) |
self.category = category | ||
self.condition = condition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use inheritance here by invoking super()
self.category = category | ||
self.condition = condition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use inheritance here by invoking super()
def __str__(self): | ||
return 'Hello World!' | ||
|
||
def condition_description(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great way to create a conditional based on ranges here!
list_by_category.append(item) | ||
return list_by_category | ||
|
||
def swap_items(self, vendor, my_item, their_item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃🏽
else: | ||
return False | ||
|
||
def swap_first_item(self, vendor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already have a function that will do this work for you! swap_items()
can be called here and then you would pass in the first item of the vender and the other vendor as arguments
return self.swap_items(other, self.inventory[0], other.inventory[0])
if item.condition == max_condition: | ||
return item | ||
|
||
def swap_best_by_category(self, other, my_priority, their_priority): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great approach using get best by category
else: | ||
self.swap_items(other, my_best, their_best) | ||
return True | ||
def swap_by_newest(self, other): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great use of swap_items()
here
Great work Faith! I liked how you approached these functions and used different built-in methods. I added some comments on refactoring and the use of helper functions. |
No description provided.