mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
name refactor
This commit is contained in:
parent
6243a16770
commit
08588baf9d
@ -2,6 +2,10 @@ package com.gildedrose;
|
||||
|
||||
class GildedRose {
|
||||
|
||||
public static final String AGED_BRIE = "Aged Brie";
|
||||
public static final String SULFURAS = "Sulfuras, Hand of Ragnaros";
|
||||
public static final String BACKSTAGE = "Backstage passes to a TAFKAL80ETC concert";
|
||||
|
||||
private Item[] items;
|
||||
|
||||
public GildedRose(Item... items) {
|
||||
@ -15,10 +19,10 @@ class GildedRose {
|
||||
}
|
||||
|
||||
private void updateItemQuality(Item item) {
|
||||
if (!item.name.equals("Aged Brie")
|
||||
&& !item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (!item.name.equals(AGED_BRIE)
|
||||
&& !item.name.equals(BACKSTAGE)) {
|
||||
if (item.quality > 0) {
|
||||
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
if (!item.name.equals(SULFURAS)) {
|
||||
item.quality = item.quality - 1;
|
||||
}
|
||||
}
|
||||
@ -26,7 +30,7 @@ class GildedRose {
|
||||
if (item.quality < 50) {
|
||||
item.quality = item.quality + 1;
|
||||
|
||||
if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (item.name.equals(BACKSTAGE)) {
|
||||
if (item.sellIn < 11) {
|
||||
if (item.quality < 50) {
|
||||
item.quality = item.quality + 1;
|
||||
@ -42,15 +46,15 @@ class GildedRose {
|
||||
}
|
||||
}
|
||||
|
||||
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
if (!item.name.equals(SULFURAS)) {
|
||||
item.sellIn = item.sellIn - 1;
|
||||
}
|
||||
|
||||
if (item.sellIn < 0) {
|
||||
if (!item.name.equals("Aged Brie")) {
|
||||
if (!item.name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (!item.name.equals(AGED_BRIE)) {
|
||||
if (!item.name.equals(BACKSTAGE)) {
|
||||
if (item.quality > 0) {
|
||||
if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
if (!item.name.equals(SULFURAS)) {
|
||||
item.quality = item.quality - 1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user