-
Notifications
You must be signed in to change notification settings - Fork 71
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
Scissors_Gloria_Villa #66
base: master
Are you sure you want to change the base?
Conversation
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.
Looks great! There are just a couple notes below of things to think about and keep in mind for the future :)
elif self.condition == 1: | ||
desc = "Might use a glove" | ||
elif self.condition == 0: | ||
desc = "Make sure you really want to do this!" |
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.
Haha
self_first_item = self.inventory[0] | ||
vendor_first_item = vendor.inventory[0] | ||
self.remove(self_first_item) | ||
self.add(vendor_first_item) | ||
vendor.remove(vendor_first_item) | ||
vendor.add(self_first_item) | ||
return True |
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.
This looks a whole lot like the code in the method above! I wonder if there's a way we could make use of that other method here...
return None | ||
|
||
best_item = None | ||
for item in self.get_by_category(category): |
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.
Love that you made use of the existing method here!
if other.get_by_category(my_priority) == None or self.get_by_category(their_priority)== None: | ||
return False | ||
|
||
my_trade_to_other = self.get_best_by_category(their_priority) | ||
their_trade_to_me = other.get_best_by_category(my_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.
One minor optimization here would be to store the results of self.get_best_by_category(their_priority)
and other.get_best_by_category(my_priority)
in variables.
When you call the methods twice, they need to do all the work twice.
Indents fixed.