mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-10 20:21:26 +00:00
r extract var
This commit is contained in:
parent
1a5d58df88
commit
a5583e4129
@ -9,10 +9,9 @@ class Item:
|
|||||||
|
|
||||||
|
|
||||||
def update_item(item: Item):
|
def update_item(item: Item):
|
||||||
if (
|
is_aged_brie = item.name == "Aged Brie"
|
||||||
item.name != "Aged Brie"
|
|
||||||
and item.name != "Backstage passes to a TAFKAL80ETC concert"
|
if not is_aged_brie and item.name != "Backstage passes to a TAFKAL80ETC concert":
|
||||||
):
|
|
||||||
if item.quality > 0:
|
if item.quality > 0:
|
||||||
if item.name != "Sulfuras, Hand of Ragnaros":
|
if item.name != "Sulfuras, Hand of Ragnaros":
|
||||||
item.quality = item.quality - 1
|
item.quality = item.quality - 1
|
||||||
@ -29,7 +28,7 @@ def update_item(item: Item):
|
|||||||
if item.name != "Sulfuras, Hand of Ragnaros":
|
if item.name != "Sulfuras, Hand of Ragnaros":
|
||||||
item.sell_in = item.sell_in - 1
|
item.sell_in = item.sell_in - 1
|
||||||
if item.sell_in < 0:
|
if item.sell_in < 0:
|
||||||
if item.name != "Aged Brie":
|
if not is_aged_brie:
|
||||||
if item.name != "Backstage passes to a TAFKAL80ETC concert":
|
if item.name != "Backstage passes to a TAFKAL80ETC concert":
|
||||||
if item.quality > 0:
|
if item.quality > 0:
|
||||||
if item.name != "Sulfuras, Hand of Ragnaros":
|
if item.name != "Sulfuras, Hand of Ragnaros":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user