Develop #1

Open
Ramtin wants to merge 35 commits from develop into main
Showing only changes of commit dc963742aa - Show all commits
@@ -15,6 +15,8 @@ import java.util.Hashtable;
public class DisplayItem { public class DisplayItem {
public static void DisplayItems(ArrayList<Item> items) { public static void DisplayItems(ArrayList<Item> items) {
for (Item item : items) { for (Item item : items) {
if (item == null) continue;
String result = item.getName(); String result = item.getName();
if (item instanceof SellableItem) { if (item instanceof SellableItem) {
@@ -30,7 +32,7 @@ public class DisplayItem {
} }
if (item instanceof IDefender) { if (item instanceof IDefender) {
result += "\n Damage = " + ((IDefender) item).GetDefense(); result += "\n Defence = " + ((IDefender) item).GetDefense();
} }
System.out.println(result); System.out.println(result);
@@ -42,6 +44,8 @@ public class DisplayItem {
Dictionary<Integer, Item> dictionary = new Hashtable<>(); Dictionary<Integer, Item> dictionary = new Hashtable<>();
for (Item item : items) { for (Item item : items) {
if (item == null) continue;
String result = index + " > " + item.getName(); String result = index + " > " + item.getName();
if (item instanceof KeyItem) { if (item instanceof KeyItem) {
@@ -61,7 +65,7 @@ public class DisplayItem {
} }
if (item instanceof IDefender) { if (item instanceof IDefender) {
result += "\n Damage = " + ((IDefender) item).GetDefense(); result += "\n Defence = " + ((IDefender) item).GetDefense();
} }
dictionary.put(index, item); dictionary.put(index, item);