mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-08 03:01:24 +00:00
28 lines
561 B
C#
28 lines
561 B
C#
namespace GildedRoseKata;
|
|
|
|
public abstract class BaseUpdateStrategy : IUpdateStrategy
|
|
{
|
|
protected static void DecreaseQuality(Item item)
|
|
{
|
|
if (item.Quality > ItemCategory.MinQuality)
|
|
{
|
|
item.Quality--;
|
|
}
|
|
}
|
|
|
|
protected static void IncreaseQuality(Item item)
|
|
{
|
|
if (item.Quality < ItemCategory.MaxQuality)
|
|
{
|
|
item.Quality++;
|
|
}
|
|
}
|
|
|
|
protected static void DecreaseSellIn(Item item)
|
|
{
|
|
item.SellIn--;
|
|
}
|
|
|
|
public abstract void UpdateQuality(Item item);
|
|
}
|