diff --git a/Jackaroo/src/GameFunctionality/Gamesystem.java b/Jackaroo/src/GameFunctionality/Gamesystem.java index 53998e0..822b235 100644 --- a/Jackaroo/src/GameFunctionality/Gamesystem.java +++ b/Jackaroo/src/GameFunctionality/Gamesystem.java @@ -14,6 +14,7 @@ public class Gamesystem { private boolean hasGameEnded = false; private int playerCounter = 0; private int playerID = 1; + private int playerPosition = 0; private ArrayList playersList= new ArrayList<>(); private ArrayList> playerCards = new ArrayList<>(); @@ -89,12 +90,34 @@ public class Gamesystem { public void playCard (int id_Card) { + for(Card card : playerCards.get(playerPosition)) { + + if(card.getID() == id_Card) { + + if(!playerCards.get(playerPosition).isEmpty()) { + + playedCards.add(card); + playerCards.get(playerPosition).remove(card); + playerPosition++; + + } + } + } + + if (playerPosition >= 4) { + playerPosition = 0; + playedCards.clear(); + } + } - public void startGame() { } + + private boolean cardChecker() { + return true; + } } \ No newline at end of file diff --git a/Jackaroo/src/Infrastructur/Card.java b/Jackaroo/src/Infrastructur/Card.java index 149a918..65f0610 100644 --- a/Jackaroo/src/Infrastructur/Card.java +++ b/Jackaroo/src/Infrastructur/Card.java @@ -18,7 +18,7 @@ public class Card { this.id = id; } - public void setKartenTyp(CardKind kartenTyp) { + public void setCardKind(CardKind kartenTyp) { this.kartenTyp = kartenTyp; } diff --git a/Jackaroo/src/Infrastructur/NormalCard.java b/Jackaroo/src/Infrastructur/NormalCard.java index 83f45cc..ee2c4fb 100644 --- a/Jackaroo/src/Infrastructur/NormalCard.java +++ b/Jackaroo/src/Infrastructur/NormalCard.java @@ -2,14 +2,19 @@ package Infrastructur; public class NormalCard extends Card{ + private int steps; + private CardKind[] laufKarten = {CardKind.TWO, CardKind.THREE, CardKind.SIX, CardKind.EIGHT, CardKind.NINE, CardKind.QUEEN}; - public NormalCard(int id, CardKind kartenTyp) { -// super(id); - setKartenTyp(kartenTyp); - // Setze den Wert basierend auf dem KartenTyp (z.B., TWO = 2, THREE = 3, etc.) - setWert(kartenTyp.ordinal() + 2); + public NormalCard(int id, CardKind kartenTyp, int steps) { + setID(id); + setCardKind(kartenTyp); + this.steps = steps; } + + public int getSteps() { + return steps; + } } diff --git a/Jackaroo/src/Infrastructur/SpecialAbility.java b/Jackaroo/src/Infrastructur/SpecialAbility.java new file mode 100644 index 0000000..d09b737 --- /dev/null +++ b/Jackaroo/src/Infrastructur/SpecialAbility.java @@ -0,0 +1,9 @@ +package Infrastructur; + +public enum SpecialAbility { + + BACKWARDS, MOVE_OWN_OR_OTHER, DISTRIBUTE_STEPS_ON_TWO, DISCARD, + SWAP_OWN_WITH_OTHER, MOVE_FORWARD_13_TÖTEN, + MOVE_FORWARD_11, MOVE_FORWARD_1 + +} diff --git a/Jackaroo/src/Infrastructur/SpecialCard.java b/Jackaroo/src/Infrastructur/SpecialCard.java index d33b313..1c7b2fa 100644 --- a/Jackaroo/src/Infrastructur/SpecialCard.java +++ b/Jackaroo/src/Infrastructur/SpecialCard.java @@ -4,11 +4,16 @@ 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) { -// super(id); - setKartenTyp(kartenTyp); + private SpecialAbility specialAbility; + + public SpecialCard(CardKind kartenTyp, SpecialAbility specialAbility) { + setCardKind(kartenTyp); + this.specialAbility = specialAbility; + } + + public SpecialAbility getSpecialAbility() { + return specialAbility; } }