Infrastructur Änderungen.

MAIN
wafialwakil 2024-03-03 12:02:52 +01:00
parent 98b5793015
commit bee12748e7
8 changed files with 78 additions and 0 deletions

BIN
.DS_Store vendored 100644

Binary file not shown.

BIN
Jackaroo/.DS_Store vendored 100644

Binary file not shown.

BIN
Jackaroo/src/.DS_Store vendored 100644

Binary file not shown.

View File

@ -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;
}
}

View File

@ -0,0 +1,7 @@
package Infrastructur;
public enum CardKind {
TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE
}

View File

@ -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());
}
}
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}