mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 16:01:42 +00:00
Fully working refactor (all tests pass).
This commit is contained in:
parent
faa4859dc5
commit
326f0e5145
@ -7,6 +7,7 @@ class GildedRose(object):
|
|||||||
|
|
||||||
def update_quality(self):
|
def update_quality(self):
|
||||||
for item in self.items:
|
for item in self.items:
|
||||||
|
|
||||||
# Set default parameters
|
# Set default parameters
|
||||||
sell_in_rate = 1
|
sell_in_rate = 1
|
||||||
quality_rate = 1
|
quality_rate = 1
|
||||||
@ -47,10 +48,6 @@ class GildedRose(object):
|
|||||||
else:
|
else:
|
||||||
quality_sign = 1
|
quality_sign = 1
|
||||||
|
|
||||||
elif item.name == "Conjured Mana Cake":
|
|
||||||
if item.sell_in < 0:
|
|
||||||
quality_rate = 2
|
|
||||||
|
|
||||||
item.sell_in -= sell_in_rate
|
item.sell_in -= sell_in_rate
|
||||||
item.quality += (quality_sign*quality_rate)
|
item.quality += (quality_sign*quality_rate)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user