added the possiblity when the drawpile has only 1 card the discard pile will be shuffeled and then put into the draw pile.
This commit is contained in:
@@ -107,9 +107,13 @@ private void initializeDrawPile() {
|
||||
*/
|
||||
public PowerCard draw() {
|
||||
if (!this.drawPile.isEmpty()) {
|
||||
if (drawPile.size() == 1){
|
||||
Collections.shuffle(this.discardPile);
|
||||
this.drawPile.addAll(this.discardPile);
|
||||
discardPile.clear();
|
||||
}
|
||||
return this.drawPile.remove(0);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user