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