mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
23 lines
432 B
C#
23 lines
432 B
C#
using System;
|
|
|
|
namespace csharp.StrategyPatternExample
|
|
{
|
|
class NormalDegradeStrategy : ICategoryStrategy
|
|
{
|
|
public void Update(Item item)
|
|
{
|
|
if (item.Quality > 0)
|
|
{
|
|
item.Quality--;
|
|
}
|
|
|
|
item.SellIn--;
|
|
|
|
if (item.SellIn < 0 && item.Quality > 0)
|
|
{
|
|
item.Quality--;
|
|
}
|
|
}
|
|
}
|
|
}
|