Kaynağa Gözat

little comments

nmaidanos 8 yıl önce
ebeveyn
işleme
2e8e3bd75b
2 değiştirilmiş dosya ile 27 ekleme ve 24 silme
  1. 4
    4
      Inventory.java
  2. 23
    20
      package.bluej

+ 4
- 4
Inventory.java Dosyayı Görüntüle

8
     }
8
     }
9
 
9
 
10
     public void updateQuality() {
10
     public void updateQuality() {
11
+
11
         for (Item item: items) {
12
         for (Item item: items) {
12
             
13
             
14
+            //This loop runs at the end of each day
15
+            //SellIn is the value which denotes the number of days we have to sell the item
16
+            //Quality value denotes how values for every item
13
             
17
             
14
-            //Quality//////////////////////////////////////////////////
15
-            //"Aged Brie" actually increases in Quality the older it gets
16
             if (item.getName().equals("Aged Brie")) {
18
             if (item.getName().equals("Aged Brie")) {
17
                 
19
                 
18
                 if (item.getQuality() < 50) {
20
                 if (item.getQuality() < 50) {
26
                         item.setQuality(item.getQuality() - 1);
28
                         item.setQuality(item.getQuality() - 1);
27
                     }
29
                     }
28
                 }
30
                 }
29
-                
30
             }
31
             }
31
-            /////////////////////////////////////////////////////////////////////
32
             
32
             
33
             
33
             
34
             if (!item.getName().equals("Sulfuras, Hand of Ragnaros")) {
34
             if (!item.getName().equals("Sulfuras, Hand of Ragnaros")) {

+ 23
- 20
package.bluej Dosyayı Görüntüle

5
 dependency2.from=InventoryTest
5
 dependency2.from=InventoryTest
6
 dependency2.to=Inventory
6
 dependency2.to=Inventory
7
 dependency2.type=UsesDependency
7
 dependency2.type=UsesDependency
8
-editor.fx.0.height=722
9
-editor.fx.0.width=800
10
-editor.fx.0.x=320
11
-editor.fx.0.y=50
12
-objectbench.height=164
13
-objectbench.width=776
8
+dependency3.from=Inventory
9
+dependency3.to=Item
10
+dependency3.type=UsesDependency
11
+editor.fx.0.height=28
12
+editor.fx.0.width=160
13
+editor.fx.0.x=-32000
14
+editor.fx.0.y=-32000
15
+objectbench.height=151
16
+objectbench.width=934
14
 package.divider.horizontal=0.6
17
 package.divider.horizontal=0.6
15
-package.divider.vertical=0.6845018450184502
16
-package.editor.height=364
17
-package.editor.width=674
18
-package.editor.x=577
19
-package.editor.y=61
20
-package.frame.height=600
21
-package.frame.width=800
22
-package.numDependencies=2
18
+package.divider.vertical=0.8331573389651531
19
+package.editor.height=782
20
+package.editor.width=844
21
+package.editor.x=953
22
+package.editor.y=0
23
+package.frame.height=1047
24
+package.frame.width=974
25
+package.numDependencies=3
23
 package.numTargets=3
26
 package.numTargets=3
24
 package.showExtends=true
27
 package.showExtends=true
25
 package.showUses=true
28
 package.showUses=true
34
 target1.showInterface=false
37
 target1.showInterface=false
35
 target1.type=ClassTarget
38
 target1.type=ClassTarget
36
 target1.width=80
39
 target1.width=80
37
-target1.x=10
38
-target1.y=100
40
+target1.x=570
41
+target1.y=180
39
 target2.height=50
42
 target2.height=50
40
 target2.name=InventoryTest
43
 target2.name=InventoryTest
41
 target2.showInterface=false
44
 target2.showInterface=false
42
 target2.type=UnitTestTargetJunit4
45
 target2.type=UnitTestTargetJunit4
43
 target2.width=80
46
 target2.width=80
44
-target2.x=40
45
-target2.y=160
47
+target2.x=570
48
+target2.y=240
46
 target3.association=InventoryTest
49
 target3.association=InventoryTest
47
 target3.height=50
50
 target3.height=50
48
 target3.name=Inventory
51
 target3.name=Inventory
49
 target3.showInterface=false
52
 target3.showInterface=false
50
 target3.type=ClassTarget
53
 target3.type=ClassTarget
51
 target3.width=80
54
 target3.width=80
52
-target3.x=10
53
-target3.y=190
55
+target3.x=540
56
+target3.y=270