mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
variable name change, hand -> ragnaros, pass -> concertPass;
;
This commit is contained in:
parent
1ad69417cc
commit
0e11a9fa76
@ -23,18 +23,18 @@ export class GildedRose {
|
||||
var maxQuality = 50;
|
||||
var minQuality = 0;
|
||||
var conjured = 'Conjured';
|
||||
var hand = 'Sulfuras, Hand of Ragnaros';
|
||||
var ragnaros = 'Sulfuras, Hand of Ragnaros';
|
||||
var cheese = 'Aged Brie';
|
||||
var pass = 'Backstage passes to a TAFKAL80ETC concert';
|
||||
var concertPass = 'Backstage passes to a TAFKAL80ETC concert';
|
||||
|
||||
for (let i = 0; i < this.items.length; i++) {
|
||||
if (this.items[i].name != cheese && this.items[i].name != pass
|
||||
&& this.items[i].name != hand && this.items[i].quality > minQuality) {
|
||||
if (this.items[i].name != cheese && this.items[i].name != concertPass
|
||||
&& this.items[i].name != ragnaros && this.items[i].quality > minQuality) {
|
||||
this.items[i].quality -=1;
|
||||
} else {
|
||||
if (this.items[i].quality < maxQuality) {
|
||||
this.items[i].quality += 1;
|
||||
if (this.items[i].name == pass) {
|
||||
if (this.items[i].name == concertPass) {
|
||||
if (this.items[i].sellIn <= 10 && this.items[i].sellIn > 5) {
|
||||
// quality goes up by 2 when days are 10 or less
|
||||
if (this.items[i].quality < maxQuality) {
|
||||
@ -51,16 +51,16 @@ export class GildedRose {
|
||||
}
|
||||
}
|
||||
// checking for legendary to subtract sell by date
|
||||
if (this.items[i].name != hand) {
|
||||
if (this.items[i].name != ragnaros) {
|
||||
this.items[i].sellIn -= 1;
|
||||
}
|
||||
|
||||
if (this.items[i].sellIn < 0) {
|
||||
if (this.items[i].name != cheese) {
|
||||
if (this.items[i].name != pass) {
|
||||
if (this.items[i].name != concertPass) {
|
||||
if (this.items[i].quality > minQuality) {
|
||||
// move this if above line 57 if
|
||||
if (this.items[i].name != hand) {
|
||||
if (this.items[i].name != ragnaros) {
|
||||
this.items[i].quality -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user