예제 #1
0
 public void UpdateItems(List <Item> items)
 {
     foreach (var item in items.Where(item => !ItemChecker.IsLegendary(item.Name)))
     {
         UpdateQuality(item);
         UpdateSellIn(item);
     }
 }
예제 #2
0
        private void DecreaseQuality(Item item)
        {
            var decrease = UpdateCalculator.Decrease(item, ItemChecker.IsConjured(item.Name));

            if (item.Quality - decrease >= 0)
            {
                item.Quality -= decrease;
            }
        }
예제 #3
0
 private void UpdateBackStagePass(Item item)
 {
     if (ItemChecker.BackStagePassExpired(item))
     {
         item.Quality = 0;
     }
     else
     {
         item.Quality += UpdateCalculator.BackStagePassIncrease(item);
     }
 }
예제 #4
0
 private void IncreaseQuality(Item item)
 {
     if (ItemChecker.IsBackStagePass(item.Name))
     {
         UpdateBackStagePass(item);
     }
     else
     {
         item.Quality += UpdateCalculator.Increase(item);
     }
 }
예제 #5
0
 private void UpdateQuality(Item item)
 {
     if (ItemChecker.IncreasesOverTime(item.Name))
     {
         IncreaseQuality(item);
     }
     else
     {
         DecreaseQuality(item);
     }
 }