@@ -15,20 +15,23 @@ public AlchemistShop() {
1515 }
1616
1717 private void fillShelves () {
18- topShelf .add (new InvisibilityPotion ());
19- topShelf .add (new InvisibilityPotion ());
20- topShelf .add (new StrengthPotion ());
21- topShelf .add (new HealingPotion ());
22- topShelf .add (new InvisibilityPotion ());
23- topShelf .add (new StrengthPotion ());
24- topShelf .add (new HealingPotion ());
25- topShelf .add (new HealingPotion ());
2618
27- bottomShelf .add (new PoisonPotion ());
28- bottomShelf .add (new PoisonPotion ());
29- bottomShelf .add (new PoisonPotion ());
30- bottomShelf .add (new HolyWaterPotion ());
31- bottomShelf .add (new HolyWaterPotion ());
19+ PotionFactory factory = new PotionFactory ();
20+
21+ topShelf .add (factory .createPotion (PotionType .INVISIBILITY ));
22+ topShelf .add (factory .createPotion (PotionType .INVISIBILITY ));
23+ topShelf .add (factory .createPotion (PotionType .STRENGTH ));
24+ topShelf .add (factory .createPotion (PotionType .HEALING ));
25+ topShelf .add (factory .createPotion (PotionType .INVISIBILITY ));
26+ topShelf .add (factory .createPotion (PotionType .STRENGTH ));
27+ topShelf .add (factory .createPotion (PotionType .HEALING ));
28+ topShelf .add (factory .createPotion (PotionType .HEALING ));
29+
30+ bottomShelf .add (factory .createPotion (PotionType .POISON ));
31+ bottomShelf .add (factory .createPotion (PotionType .POISON ));
32+ bottomShelf .add (factory .createPotion (PotionType .POISON ));
33+ bottomShelf .add (factory .createPotion (PotionType .HOLY_WATER ));
34+ bottomShelf .add (factory .createPotion (PotionType .HOLY_WATER ));
3235 }
3336
3437 public void enumerate () {
0 commit comments