mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
27 lines
524 B
C#
27 lines
524 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace csharp.StrategyPatternExample
|
|
{
|
|
class OlderIsBetterStrategy : ICategoryStrategy
|
|
{
|
|
public void Update(Item item)
|
|
{
|
|
if (item.Quality < 50)
|
|
{
|
|
item.Quality++;
|
|
}
|
|
|
|
item.SellIn--;
|
|
|
|
if (item.SellIn < 0 && item.Quality < 50)
|
|
{
|
|
item.Quality++;
|
|
}
|
|
}
|
|
}
|
|
}
|