mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
- Adding code comments
- Removing blank spaces
This commit is contained in:
parent
476116d783
commit
e55dae2ce7
@ -12,6 +12,7 @@ struct AgedBrieItem: CustomisedItem, ItemStateUpdater{
|
||||
var item: Item
|
||||
|
||||
private var isItemUnderHighestQuality: Bool {
|
||||
// Returns true if quality of item is less than Hightest Quality(50)
|
||||
return item.quality < ValueConstants.kHightestQualityValue
|
||||
}
|
||||
|
||||
|
||||
@ -12,10 +12,12 @@ struct BackstagePassesItem: CustomisedItem, ItemStateUpdater {
|
||||
var item: Item
|
||||
|
||||
private var isItemUnderHighestQuality: Bool {
|
||||
// Returns true if Item Quality is less than Highest value (50)
|
||||
return item.quality < ValueConstants.kHightestQualityValue
|
||||
}
|
||||
|
||||
private var isSellInDatePassed: Bool{
|
||||
// Returns true if sell in date is passed
|
||||
return item.sellIn < 0
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ class StandardItem: CustomisedItem, ItemStateUpdater {
|
||||
var item: Item
|
||||
|
||||
private var isSellInDatePassed: Bool{
|
||||
// Returns true if the sellin date is passed
|
||||
return item.sellIn < 0
|
||||
}
|
||||
|
||||
@ -22,6 +23,7 @@ class StandardItem: CustomisedItem, ItemStateUpdater {
|
||||
}
|
||||
|
||||
private var isItemMoreThanLowestQuality: Bool {
|
||||
// Returns true if Quality of item is more than lowest quality(0)
|
||||
return item.quality > ValueConstants.kLowestQualityValue
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
protocol CustomisedItem {
|
||||
var item: Item {get set}
|
||||
var item: Item { get set }
|
||||
func updateItemState()
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user