mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
25 lines
449 B
Swift
25 lines
449 B
Swift
//
|
|
// File.swift
|
|
//
|
|
//
|
|
// Created by Manali Mogre on 17/08/2020.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
protocol ItemSellInUpdater: CustomisedItem{
|
|
var decreasingNumberOfSellInDays: Int { get }
|
|
func updateSellInDays()
|
|
}
|
|
|
|
extension ItemSellInUpdater {
|
|
var decreasingNumberOfSellInDays: Int {
|
|
return 1
|
|
}
|
|
|
|
// Reduces the sell in days by 1
|
|
func updateSellInDays() {
|
|
item.sellIn -= decreasingNumberOfSellInDays
|
|
}
|
|
}
|