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