Develop #1

Open
Ramtin wants to merge 35 commits from develop into main
2 changed files with 37 additions and 0 deletions
Showing only changes of commit 7f41ccf7b5 - Show all commits
@@ -0,0 +1,12 @@
package org.project.constants.gameConstant;
public enum ItemClass {
KEY,
SELLABLE,
UNNECESSARY,
ACCESSORY,
SHIELD,
WEAPON,
COSTUME,
}
@@ -0,0 +1,25 @@
package org.project.constants.gameConstant;
import org.project.item.Accessory.Accessory;
import org.project.item.Accessory.Costume;
import org.project.item.Accessory.Shield;
import org.project.item.Accessory.Weapon;
import org.project.item.KeyItem;
import org.project.item.SellableItem;
public final class ItemClassExt {
private ItemClassExt() {}
public static boolean Matches(ItemClass itemClass, Object subject) {
return switch (itemClass) {
case KEY -> subject instanceof KeyItem;
case SELLABLE -> subject instanceof SellableItem;
case UNNECESSARY -> subject.getClass() == SellableItem.class;
case ACCESSORY -> subject instanceof Accessory;
case WEAPON -> subject instanceof Weapon;
case COSTUME -> subject instanceof Costume;
case SHIELD -> subject instanceof Shield;
case null, default -> false;
};
}
}