Skip to content

Kristina K. - Maple#81

Open
k0axaca wants to merge 8 commits into
Ada-C16:masterfrom
k0axaca:master
Open

Kristina K. - Maple#81
k0axaca wants to merge 8 commits into
Ada-C16:masterfrom
k0axaca:master

Conversation

@k0axaca

@k0axaca k0axaca commented Oct 1, 2021

Copy link
Copy Markdown

No description provided.

Comment thread swap_meet/clothing.py

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

@tgoslee tgoslee Oct 7, 2021

Copy link
Copy Markdown

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.

Comment thread swap_meet/item.py
return "some signs of wear"
elif self.condition == 4:
return "almost new"
elif self.condition == 5:

Copy link
Copy Markdown

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:

Comment thread swap_meet/vendor.py
item_list.append(item)
return item_list

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

great job!

Comment thread swap_meet/vendor.py
else:
return False

def swap_first_item(self, vendor):

Copy link
Copy Markdown

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

Comment thread swap_meet/vendor.py
vendor.inventory[0] = first_item_a
return True

def get_best_by_category(self, type):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💃🏽

Comment thread swap_meet/vendor.py

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

Copy link
Copy Markdown

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

tgoslee commented Oct 7, 2021

Copy link
Copy Markdown

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