Eric Foster 6 years ago
parent
commit
44a59d1b31
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      Inventory.java

+ 4
- 2
Inventory.java View File

9
 
9
 
10
     public void updateInventory() {
10
     public void updateInventory() {
11
         for (int i = 0; i < items.length; i++) {
11
         for (int i = 0; i < items.length; i++) {
12
-            if(!items[i].getName().equals("Sulfuras, Hand of Ragnaros")){
12
+            if(items[i].getName().equals("Sulfuras, Hand of Ragnaros")){
13
+                break;
14
+            } else {
13
                 updateQuality(items[i]);
15
                 updateQuality(items[i]);
14
                 updateSellInDays(items[i]);
16
                 updateSellInDays(items[i]);
15
                 if (items[i].getSellIn() < 0) {
17
                 if (items[i].getSellIn() < 0) {
62
             reduceQualityBy1(item);
64
             reduceQualityBy1(item);
63
         }
65
         }
64
     }
66
     }
65
-    
67
+
66
     public void reduceQualityBy1(Item item){
68
     public void reduceQualityBy1(Item item){
67
         item.setQuality(item.getQuality() -1);
69
         item.setQuality(item.getQuality() -1);
68
     }
70
     }