Infrastructur Änderungen.
parent
98b5793015
commit
bee12748e7
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,25 @@
|
|||
package Infrastructur;
|
||||
|
||||
public class Card {
|
||||
|
||||
private int wert;
|
||||
private CardKind kartenTyp;
|
||||
|
||||
public void setWert(int wert) {
|
||||
this.wert = wert;
|
||||
}
|
||||
|
||||
public void setKartenTyp(CardKind kartenTyp) {
|
||||
this.kartenTyp = kartenTyp;
|
||||
}
|
||||
|
||||
public int getWert() {
|
||||
return wert;
|
||||
}
|
||||
|
||||
public CardKind getKartenTyp() {
|
||||
return kartenTyp;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package Infrastructur;
|
||||
|
||||
public enum CardKind {
|
||||
|
||||
TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package Infrastructur;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Deck extends Card{
|
||||
|
||||
private List<Card> deck;
|
||||
|
||||
public Deck() {
|
||||
deck = new ArrayList<>();
|
||||
for (CardKind kartenTyp : CardKind.values()) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
deck.add(new Card());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package Infrastructur;
|
||||
|
||||
public class NormalCard extends Card{
|
||||
|
||||
private CardKind[] laufKarten = {CardKind.TWO, CardKind.THREE, CardKind.SIX, CardKind.EIGHT, CardKind.NINE,
|
||||
CardKind.QUEEN};
|
||||
|
||||
public NormalCard(CardKind kartenTyp) {
|
||||
setKartenTyp(kartenTyp);
|
||||
// Setze den Wert basierend auf dem KartenTyp (z.B., TWO = 2, THREE = 3, etc.)
|
||||
setWert(kartenTyp.ordinal() + 2);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package Infrastructur;
|
||||
|
||||
public class SpecialCard extends Card{
|
||||
|
||||
private CardKind[] eigenschaftKarten = {CardKind.FOUR, CardKind.FIVE, CardKind.SEVEN, CardKind.TEN,
|
||||
CardKind.JACK, CardKind.KING, CardKind.ACE};
|
||||
|
||||
|
||||
public SpecialCard(CardKind kartenTyp) {
|
||||
setKartenTyp(kartenTyp);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue