Skip to content
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

Kristina K. - Maple #81

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Kristina K. - Maple #81

wants to merge 8 commits into from

Conversation

k0axaca
Copy link

@k0axaca k0axaca commented Oct 1, 2021

No description provided.


class Clothing(Item):
def __init__(self, condition = 0):
super().__init__(category = "Clothing", condition = condition)
Copy link

@tgoslee tgoslee Oct 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job on using inheritance here. Another way you could save some time on your code is to just leave condition as is instead of condition = condition. Nothing major just fyi.

return "some signs of wear"
elif self.condition == 4:
return "almost new"
elif self.condition == 5:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the last one would just use else

Suggested change
elif self.condition == 5:
else:

item_list.append(item)
return item_list

def swap_items(self, vendor, my_item, their_item):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job!

else:
return False

def swap_first_item(self, vendor):
Copy link

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])

vendor.inventory[0] = first_item_a
return True

def get_best_by_category(self, type):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃🏽


if vendor_best_item == None or other_best_item == None:
return False
else:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could also call swap_items() here as well

@tgoslee
Copy link

tgoslee commented Oct 7, 2021

Good Job! Your code was clean and readable. I added comments on refactoring some of your code and using helper functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants