|
@@ -13,53 +13,35 @@ public class Inventory {
|
13
|
13
|
public void updateQuality() {
|
14
|
14
|
for (int i = 0; i < items.length; i++) {
|
15
|
15
|
if (!items[i].getName().equals("Aged Brie")
|
16
|
|
- && !items[i].getName().equals("Backstage passes to a TAFKAL80ETC concert")) {
|
17
|
|
- if (items[i].getQuality() > 0) {
|
18
|
|
- if (!items[i].getName().equals("Sulfuras, Hand of Ragnaros")) {
|
19
|
|
- items[i].setQuality(items[i].getQuality() - 1);
|
20
|
|
- }
|
21
|
|
- }
|
22
|
|
- } else {
|
23
|
|
- if (items[i].getQuality() < 50) {
|
24
|
|
- items[i].setQuality(items[i].getQuality() + 1);
|
25
|
|
-
|
26
|
|
- if (items[i].getName() == "Backstage passes to a TAFKAL80ETC concert") {
|
27
|
|
- if (items[i].getSellIn() < 11) {
|
28
|
|
- if (items[i].getQuality() < 50) {
|
29
|
|
- items[i].setQuality(items[i].getQuality() + 1);
|
30
|
|
- }
|
31
|
|
- }
|
|
16
|
+ && !items[i].getName().equals("Backstage passes to a TAFKAL80ETC concert") && items[i].getQuality() > 0
|
|
17
|
+ && !items[i].getName().equals("Sulfuras, Hand of Ragnaros")) {
|
|
18
|
+ items[i].setQuality(items[i].getQuality() - 1);
|
|
19
|
+ }
|
|
20
|
+ if (items[i].getQuality() < 50) {
|
|
21
|
+ items[i].setQuality(items[i].getQuality() + 1);
|
|
22
|
+ }
|
32
|
23
|
|
33
|
|
- if (items[i].getSellIn() < 6) {
|
34
|
|
- if (items[i].getQuality() < 50) {
|
35
|
|
- items[i].setQuality(items[i].getQuality() + 1);
|
36
|
|
- }
|
37
|
|
- }
|
38
|
|
- }
|
39
|
|
- }
|
|
24
|
+ if (items[i].getName() == "Backstage passes to a TAFKAL80ETC concert" && items[i].getSellIn() < 11
|
|
25
|
+ && items[i].getQuality() < 50) {
|
|
26
|
+ items[i].setQuality(items[i].getQuality() + 1);
|
|
27
|
+ }
|
|
28
|
+ if (items[i].getSellIn() < 6 && items[i].getQuality() < 50) {
|
|
29
|
+ items[i].setQuality(items[i].getQuality() + 1);
|
40
|
30
|
}
|
41
|
31
|
|
42
|
32
|
if (!items[i].getName().equals("Sulfuras, Hand of Ragnaros")) {
|
43
|
33
|
items[i].setSellIn(items[i].getSellIn() - 1);
|
44
|
34
|
}
|
45
|
35
|
|
46
|
|
- if (items[i].getSellIn() < 0) {
|
47
|
|
- if (!items[i].getName().equals("Aged Brie")) {
|
48
|
|
- if (!items[i].getName().equals("Backstage passes to a TAFKAL80ETC concert")) {
|
49
|
|
- if (items[i].getQuality() > 0) {
|
50
|
|
- if (!items[i].getName().equals("Sulfuras, Hand of Ragnaros")) {
|
51
|
|
- items[i].setQuality(items[i].getQuality() - 1);
|
52
|
|
- }
|
53
|
|
- }
|
54
|
|
- } else {
|
55
|
|
- items[i].setQuality(items[i].getQuality()
|
56
|
|
- - items[i].getQuality());
|
57
|
|
- }
|
58
|
|
- } else {
|
59
|
|
- if (items[i].getQuality() < 50) {
|
60
|
|
- items[i].setQuality(items[i].getQuality() + 1);
|
61
|
|
- }
|
62
|
|
- }
|
|
36
|
+ if (items[i].getSellIn() < 0 && !items[i].getName().equals("Aged Brie") &&
|
|
37
|
+ !items[i].getName().equals("Backstage passes to a TAFKAL80ETC concert") && items[i].getQuality() > 0
|
|
38
|
+ && !items[i].getName().equals("Sulfuras, Hand of Ragnaros")) {
|
|
39
|
+ items[i].setQuality(items[i].getQuality() - 1);
|
|
40
|
+ } else {
|
|
41
|
+ items[i].setQuality(items[i].getQuality() - items[i].getQuality());
|
|
42
|
+ }
|
|
43
|
+ if (items[i].getQuality() < 50) {
|
|
44
|
+ items[i].setQuality(items[i].getQuality() + 1);
|
63
|
45
|
}
|
64
|
46
|
}
|
65
|
47
|
}
|