Add MonsterCard

This commit is contained in:
P0nk
2023-07-25 17:52:38 +02:00
parent 84ad5b4db8
commit e31465a1b5
2 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
package database.monsterbook;
public record MonsterCard(int cardId, byte level) {
public MonsterCard {
if (cardId / 10_000 != 238) {
throw new IllegalArgumentException("Invalid monster card id: %d".formatted(cardId));
}
if (level < 0 || level > 5) {
throw new IllegalArgumentException("Invalid monster card level: %d".formatted(level));
}
}
public boolean isSpecial() {
return cardId / 1000 == 2388;
}
}