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