mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-04 09:11:39 +00:00
Remove individual quality update methods since they are implemented in individual strategies
This commit is contained in:
parent
3271c24591
commit
ddeca6dfef
@ -207,32 +207,6 @@ class GildedRose:
|
|||||||
"""
|
"""
|
||||||
self.items = items
|
self.items = items
|
||||||
|
|
||||||
def _increase_quality(self, item: Item, amount: int = 1) -> None:
|
|
||||||
"""Increase the quality of an item, ensuring it does not exceed MAX_QUALITY.
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
----------
|
|
||||||
item : Item
|
|
||||||
The item whose quality is to be increased.
|
|
||||||
amount : int, optional
|
|
||||||
The amount to increase the quality by (default is 1).
|
|
||||||
|
|
||||||
"""
|
|
||||||
item.quality = min(MAX_QUALITY, item.quality + amount)
|
|
||||||
|
|
||||||
def _decrease_quality(self, item: Item, amount: int = 1) -> None:
|
|
||||||
"""Decrease the quality of an item, ensuring it does not go below MIN_QUALITY.
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
----------
|
|
||||||
item : Item
|
|
||||||
The item whose quality is to be decreased.
|
|
||||||
amount : int, optional
|
|
||||||
The amount to decrease the quality by (default is 1).
|
|
||||||
|
|
||||||
"""
|
|
||||||
item.quality = max(MIN_QUALITY, item.quality - amount)
|
|
||||||
|
|
||||||
def update_quality(self) -> None:
|
def update_quality(self) -> None:
|
||||||
"""Update quality and sell_in for all items according to the business rules."""
|
"""Update quality and sell_in for all items according to the business rules."""
|
||||||
for item in self.items:
|
for item in self.items:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user