Browse Source

add fillDrawDeck

main
fdai7906 11 months ago
parent
commit
02d30a8a06
  1. 18
      src/main/java/de/hsfulda/onses/services/GameService.java

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

@ -4,6 +4,8 @@ import de.hsfulda.onses.models.Card;
import de.hsfulda.onses.models.Game; import de.hsfulda.onses.models.Game;
import de.hsfulda.onses.models.Player; import de.hsfulda.onses.models.Player;
import java.util.Collections;
public class GameService { public class GameService {
private final Game game; private final Game game;
public GameService(Game game) { public GameService(Game game) {
@ -34,4 +36,20 @@ public class GameService {
return legalMoveFound; return legalMoveFound;
} }
public void fillDrawDeck() {
for (Card.Color i : Card.Color.values()){
for (Card.Value j : Card.Value.values()){
if (i != Card.Color.BLACK && j != Card.Value.CHOOSE && j != Card.Value.CHOOSEDRAW){
game.addCardToDrawCardDeck(new Card().setColor(i).setValue(j));
game.addCardToDrawCardDeck(new Card().setColor(i).setValue(j));
}
}
}
for (int i = 0; i != 4; i++){
game.addCardToDrawCardDeck(new Card().setColor(Card.Color.BLACK).setValue(Card.Value.CHOOSE));
game.addCardToDrawCardDeck(new Card().setColor(Card.Color.BLACK).setValue(Card.Value.CHOOSEDRAW));
}
}
} }
Loading…
Cancel
Save