|
|
@@ -8,7 +8,6 @@ public class Inventory {
|
|
8
|
8
|
}
|
|
9
|
9
|
|
|
10
|
10
|
public void updateQuality() {
|
|
11
|
|
-
|
|
12
|
11
|
for (int i = 0; i < items.length; i++) {
|
|
13
|
12
|
if (!items[i].getName().equals("Aged Brie") && !items[i].getName().equals("Sulfuras, Hand of Ragnaros")){
|
|
14
|
13
|
if (items[i].getQuality() > 0) {
|
|
|
@@ -18,22 +17,9 @@ public class Inventory {
|
|
18
|
17
|
} else if (items[i].getQuality() < 50) {
|
|
19
|
18
|
items[i].setQuality(items[i].getQuality() + 1);
|
|
20
|
19
|
}
|
|
21
|
|
-
|
|
22
|
|
- //if the item name is not Sulfuras and HandOfRagnaros
|
|
23
|
|
- // the sell in value descrease by 1
|
|
24
|
|
-
|
|
25
|
|
- //if (!items[i].getName().equals("Sulfuras, Hand of Ragnaros")) {
|
|
26
|
|
- // items[i].setSellIn(items[i].getSellIn() - 1);
|
|
27
|
|
- //}
|
|
28
|
|
-
|
|
29
|
|
- // if the sell in day of the item is
|
|
30
|
|
- // less than 0
|
|
31
|
|
- // && the name is not Brie
|
|
32
|
|
- //then the quality of the item
|
|
33
|
|
- // decrease by one
|
|
34
|
|
- // else
|
|
|
20
|
+
|
|
35
|
21
|
if (items[i].getSellIn() < 0) {
|
|
36
|
|
- if (!items[i].getName().equals("Aged Brie")) {
|
|
|
22
|
+ if (!items[i].getName().equals("Aged Brie")) {
|
|
37
|
23
|
items[i].setQuality(items[i].getQuality() - 1);
|
|
38
|
24
|
|
|
39
|
25
|
} else if (items[i].getQuality() < 50) {
|