mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-07-26 09:11:26 +00:00
Conjured items degrade twice as fast: -2 before sell-by, -4 after, never below 0. Registered in ItemUpdaterFactory.Default() and resolved by the Conjured prefix rule, so the whole Conjured family is covered. The four Conjured spec tests go green. The ThirtyDays approval snapshot now shows the intended Conjured-only diff; it is re-approved in the next commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
18 lines
479 B
C#
18 lines
479 B
C#
namespace GildedRoseKata;
|
|
|
|
public class ConjuredItemUpdater : ItemUpdaterBase
|
|
{
|
|
// Matched by prefix in ItemUpdaterFactory: handles every "Conjured..." item.
|
|
public override string Name => ItemUpdaterFactory.ConjuredPrefix;
|
|
|
|
public override void Update(Item item)
|
|
{
|
|
item.Quality = ClampQuality(item.Quality - 2);
|
|
item.SellIn -= 1;
|
|
if (item.SellIn < 0)
|
|
{
|
|
item.Quality = ClampQuality(item.Quality - 2);
|
|
}
|
|
}
|
|
}
|