|
@@ -9,6 +9,11 @@ public class Inventory {
|
9
|
9
|
|
10
|
10
|
public void updateQuality() {
|
11
|
11
|
for (int i = 0; i < items.length; i++) {
|
|
12
|
+ if (items[i].getName().equals("Sulfuras, Hand of Ragnaros")) {
|
|
13
|
+ //items[i].setSellIn(items[i].getSellIn() - 1);
|
|
14
|
+ continue;
|
|
15
|
+ }
|
|
16
|
+
|
12
|
17
|
if (!items[i].getName().equals("Aged Brie")) {
|
13
|
18
|
regItemUpdate();
|
14
|
19
|
// if (items[i].getQuality() > 0) {
|
|
@@ -23,9 +28,8 @@ public class Inventory {
|
23
|
28
|
}
|
24
|
29
|
|
25
|
30
|
|
26
|
|
- if (!items[i].getName().equals("Sulfuras, Hand of Ragnaros")) {
|
27
|
|
- // items[i].setSellIn(items[i].getSellIn() - 1);
|
28
|
|
- continue;
|
|
31
|
+ if(items[i].getQuality() < 80){
|
|
32
|
+ items[i].setSellIn( items[i].getSellIn() - 1);
|
29
|
33
|
}
|
30
|
34
|
|
31
|
35
|
// if (items[i].getSellIn() < 0) {
|
|
@@ -52,9 +56,9 @@ public class Inventory {
|
52
|
56
|
|
53
|
57
|
public void regItemUpdate() {
|
54
|
58
|
int i = 0;
|
55
|
|
- if (items[i].getSellIn() > 0) {
|
|
59
|
+ if (items[i].getSellIn() > 0 && items[i].getQuality() > 0) {
|
56
|
60
|
items[i].setQuality(items[i].getQuality() - 1);
|
57
|
|
- } else if (items[i].getSellIn() < 0){
|
|
61
|
+ } else if (items[i].getSellIn() < 0 && items[i].getQuality() > 1){
|
58
|
62
|
items[i].setQuality(items[i].getQuality() - 2);
|
59
|
63
|
}
|
60
|
64
|
|