need to discard black cards so reshuffling actually works
This commit is contained in:
parent
482361fa46
commit
891d2a36a1
|
@ -602,22 +602,26 @@ public class Game {
|
||||||
|
|
||||||
playedCards.clear();
|
playedCards.clear();
|
||||||
|
|
||||||
synchronized (blackCardLock) {
|
BlackCard newBlackCard;
|
||||||
blackCard = getNextBlackCard();
|
|
||||||
|
|
||||||
if (blackCard.getDraw() > 0) {
|
synchronized (blackCardLock) {
|
||||||
synchronized (players) {
|
if (blackCard != null) {
|
||||||
for (final Player player : players) {
|
blackDeck.discard(blackCard);
|
||||||
if (getJudge() == player) {
|
}
|
||||||
continue;
|
newBlackCard = blackCard = getNextBlackCard();
|
||||||
}
|
}
|
||||||
final List<WhiteCard> cards = new ArrayList<WhiteCard>(blackCard.getDraw());
|
if (newBlackCard.getDraw() > 0) {
|
||||||
for (int i = 0; i < blackCard.getDraw(); i++) {
|
synchronized (players) {
|
||||||
cards.add(getNextWhiteCard());
|
for (final Player player : players) {
|
||||||
}
|
if (getJudge() == player) {
|
||||||
player.getHand().addAll(cards);
|
continue;
|
||||||
sendCardsToPlayer(player, cards);
|
|
||||||
}
|
}
|
||||||
|
final List<WhiteCard> cards = new ArrayList<WhiteCard>(newBlackCard.getDraw());
|
||||||
|
for (int i = 0; i < newBlackCard.getDraw(); i++) {
|
||||||
|
cards.add(getNextWhiteCard());
|
||||||
|
}
|
||||||
|
player.getHand().addAll(cards);
|
||||||
|
sendCardsToPlayer(player, cards);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue