diff --git a/src/shop.py b/src/shop.py index e20548c..f0a13eb 100644 --- a/src/shop.py +++ b/src/shop.py @@ -3,8 +3,8 @@ from src.item import Item class Shop: def __init__(self, ects, buyable_items): - self.ects = ects # give the ects object ot the shop - self.buyable_items: list[Item] = buyable_items # give the buyable items to the shop + self.ects = ects # give the ects object to the shop + self.buyable_items: list[Item] = buyable_items def buy(self, item_name): item_to_buy = self.get_item(item_name) @@ -12,11 +12,12 @@ class Shop: return False cost = item_to_buy.get_cost() - if self.ects.is_over_balance(cost): + + # is_over_balance() means "has enough balance" + if not self.ects.is_over_balance(cost): return False self.ects.decrease_balance(cost) - # self.buyable_items.remove(item_to_buy) return True def get_item(self, item_name):