2023-10-05 23:49:36 +02:00
|
|
|
/*
|
|
|
|
============================================================
|
|
|
|
This is the "Karte" file from Author: Philipp Kotte
|
|
|
|
written on: 05 / 10 / 2023 at: 23:28
|
|
|
|
============================================================
|
|
|
|
*/
|
|
|
|
package Domain.Karten;
|
|
|
|
|
2023-10-23 10:50:20 +02:00
|
|
|
public abstract class Karte {
|
|
|
|
|
|
|
|
private static int kartenId = 0;
|
|
|
|
|
|
|
|
public Karte() {
|
|
|
|
if (kartenId <= 60) {
|
|
|
|
setKartenId();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
throw new RuntimeException("Es darf nur 60 Karten im Spiel geben.");
|
|
|
|
}
|
|
|
|
}
|
2023-10-05 23:49:36 +02:00
|
|
|
|
2023-10-23 10:50:20 +02:00
|
|
|
public static int getKartenId() {
|
|
|
|
return kartenId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setKartenId() {
|
|
|
|
kartenId++;
|
|
|
|
}
|
|
|
|
|
2023-10-05 23:49:36 +02:00
|
|
|
}
|