mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-04 09:11:39 +00:00
fixed enums
This commit is contained in:
parent
b0580cba9b
commit
ae332e1ed5
@ -10,17 +10,22 @@ from python.components.gilded_rose import Item
|
||||
class UpdateItemLogic:
|
||||
@staticmethod
|
||||
def update_items(items: list[Item]):
|
||||
quality, sell_in = None, None # initializing values
|
||||
for item in items:
|
||||
if item.name == item.aged_brie:
|
||||
if item.name == Items.aged_brie.value:
|
||||
quality, sell_in = AgedBrieLogic(item).update_quality()
|
||||
elif item.name == Item.backstage_passes:
|
||||
elif item.name == Items.backstage_passes.value:
|
||||
quality, sell_in = BackstagePassesLogic(item).update_quality()
|
||||
elif item.name == Item.sulfuras:
|
||||
elif item.name == Items.sulfuras.value:
|
||||
quality, sell_in = SulfurasLogic(item).update_quality()
|
||||
elif item.name == Item.conjured:
|
||||
elif item.name == Items.conjured.value:
|
||||
quality, sell_in = ConjuredItem(item).update_quality()
|
||||
else:
|
||||
quality, sell_in = NormalItemLogic(item).update_quality()
|
||||
|
||||
return quality, sell_in
|
||||
return quality, sell_in
|
||||
|
||||
# testing
|
||||
#quality, sell_in = UpdateItemLogic().update_items([Item(name="Aged Brie", quality=10, sell_in=5)])
|
||||
#quality, sell_in = UpdateItemLogic().update_items([Item(name="Backstage Passes", quality=10, sell_in=5)])
|
||||
# quality, sell_in = UpdateItemLogic().update_items([Item(name="Conjured", quality=10, sell_in=5)])
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user