|
@ -14,14 +14,7 @@ public class GameService { |
|
|
this.game.setGameService(this); |
|
|
this.game.setGameService(this); |
|
|
fillDrawDeck(); |
|
|
fillDrawDeck(); |
|
|
shuffleDeck(); |
|
|
shuffleDeck(); |
|
|
|
|
|
|
|
|
for (int i = 0; i < this.game.getDrawCardDeck().size(); i++) { |
|
|
|
|
|
Card card = this.game.getDrawCardDeck().get(i); |
|
|
|
|
|
if (card.getColor() != Card.Color.BLACK) { |
|
|
|
|
|
this.game.setLastPlayedCard(card); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
setFirstCard(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public GameService() { |
|
|
public GameService() { |
|
@ -130,4 +123,14 @@ public class GameService { |
|
|
Collections.shuffle(game.getDrawCardDeck()); |
|
|
Collections.shuffle(game.getDrawCardDeck()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setFirstCard() { |
|
|
|
|
|
for (int i = 0; i < this.game.getDrawCardDeck().size(); i++) { |
|
|
|
|
|
Card card = this.game.getDrawCardDeck().get(i); |
|
|
|
|
|
if (card.getColor() != Card.Color.BLACK) { |
|
|
|
|
|
this.game.setLastPlayedCard(card); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |