Browse Source

refactoring: adjusting playCard

main
fdai7793 11 months ago
parent
commit
65612f4e84
  1. 33
      src/main/java/de/hsfulda/onses/services/GameService.java

33
src/main/java/de/hsfulda/onses/services/GameService.java

@ -59,34 +59,33 @@ public class GameService {
game.setLastPlayedCard(card); game.setLastPlayedCard(card);
// check for special rules (draw, colorchoose, skip,...) // check for special rules (draw, colorchoose, skip,...)
// Skip // Skip
if (card.getValue() == Card.Value.SKIP) {
switch (card.getValue()) {
case SKIP:
nextPlayer(); nextPlayer();
nextPlayer(); nextPlayer();
}
// Reverse
if (card.getValue() == Card.Value.REVERSE) {
break;
case REVERSE:
nextPlayer(); nextPlayer();
nextPlayer(); nextPlayer();
}
// Choose
if (card.getValue() == Card.Value.CHOOSE) {
break;
case CHOOSE:
// Abfrage Farbe // Abfrage Farbe
Card.Color color = Card.Color.BLUE; //Vorübergehend Blau Card.Color color = Card.Color.BLUE; //Vorübergehend Blau
game.changeLastPlayedCardColor(color); game.changeLastPlayedCardColor(color);
nextPlayer(); nextPlayer();
}
// Draw
if (card.getValue() == Card.Value.DRAWTWO) {
nextPlayer();
drawCard(2);
}
// ChooseDraw
if (card.getValue() == Card.Value.CHOOSEDRAW) {
break;
case CHOOSEDRAW:
// Abfrage Farbe // Abfrage Farbe
Card.Color color = Card.Color.BLUE; //Vorübergehend Blau
game.changeLastPlayedCardColor(color);
Card.Color color1 = Card.Color.BLUE; //Vorübergehend Blau
game.changeLastPlayedCardColor(color1);
nextPlayer(); nextPlayer();
drawCard(4); drawCard(4);
break;
case DRAWTWO:
nextPlayer();
drawCard(2);
break;
} }
} }

Loading…
Cancel
Save