mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 16:58:56 +00:00
Use java 11 (#1050)
This commit is contained in:
@@ -40,17 +40,17 @@ public class TreasureChest {
|
||||
* Constructor
|
||||
*/
|
||||
public TreasureChest() {
|
||||
items = new ArrayList<>();
|
||||
items.add(new Item(ItemType.POTION, "Potion of courage"));
|
||||
items.add(new Item(ItemType.RING, "Ring of shadows"));
|
||||
items.add(new Item(ItemType.POTION, "Potion of wisdom"));
|
||||
items.add(new Item(ItemType.POTION, "Potion of blood"));
|
||||
items.add(new Item(ItemType.WEAPON, "Sword of silver +1"));
|
||||
items.add(new Item(ItemType.POTION, "Potion of rust"));
|
||||
items.add(new Item(ItemType.POTION, "Potion of healing"));
|
||||
items.add(new Item(ItemType.RING, "Ring of armor"));
|
||||
items.add(new Item(ItemType.WEAPON, "Steel halberd"));
|
||||
items.add(new Item(ItemType.WEAPON, "Dagger of poison"));
|
||||
items = List.of(
|
||||
new Item(ItemType.POTION, "Potion of courage"),
|
||||
new Item(ItemType.RING, "Ring of shadows"),
|
||||
new Item(ItemType.POTION, "Potion of wisdom"),
|
||||
new Item(ItemType.POTION, "Potion of blood"),
|
||||
new Item(ItemType.WEAPON, "Sword of silver +1"),
|
||||
new Item(ItemType.POTION, "Potion of rust"),
|
||||
new Item(ItemType.POTION, "Potion of healing"),
|
||||
new Item(ItemType.RING, "Ring of armor"),
|
||||
new Item(ItemType.WEAPON, "Steel halberd"),
|
||||
new Item(ItemType.WEAPON, "Dagger of poison"));
|
||||
}
|
||||
|
||||
public Iterator<Item> iterator(ItemType itemType) {
|
||||
|
||||
Reference in New Issue
Block a user