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

C16MapleFaithKauweSwap-MeetFinal #73

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

Conversation

FaithKauwe
Copy link

No description provided.

Comment on lines +4 to +5
self.category = category
self.condition = condition
Copy link

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

Suggested change
self.category = category
self.condition = condition
super().__init__(category="Clothing",condition)

Comment on lines +4 to +5
self.category = category
self.condition = condition
Copy link

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

Comment on lines +4 to +5
self.category = category
self.condition = condition
Copy link

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):
Copy link

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):
Copy link

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):
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.

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):
Copy link

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):
Copy link

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

@tgoslee
Copy link

tgoslee commented Oct 7, 2021

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.

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