Skip to content
Snippets Groups Projects
Commit b4ce51a3 authored by Administrator's avatar Administrator
Browse files

Fixed #4

parent 82085f80
Branches
Tags
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -81,6 +81,7 @@ public class Controller ...@@ -81,6 +81,7 @@ public class Controller
public Settings settings; public Settings settings;
public AchievementHandler handler; public AchievementHandler handler;
private int secretCounter; private int secretCounter;
private boolean playerHasDrawn;
public Stage stage; public Stage stage;
public Image icon = new Image("images/icon.png"); public Image icon = new Image("images/icon.png");
...@@ -182,6 +183,7 @@ public class Controller ...@@ -182,6 +183,7 @@ public class Controller
menuItem2.setDisable(true); menuItem2.setDisable(true);
drawCounter = 0; drawCounter = 0;
playerHasDrawn = false;
labelCurrentPlayer.setVisible(true); labelCurrentPlayer.setVisible(true);
iconDeck.setImage(createEmptyBackCard()); iconDeck.setImage(createEmptyBackCard());
...@@ -190,8 +192,9 @@ public class Controller ...@@ -190,8 +192,9 @@ public class Controller
@Override @Override
public void handle(MouseEvent event) public void handle(MouseEvent event)
{ {
if(game.isRunning() && game.getCurrentPlayer() == 1 && !game.isShowingInfo()) if(game.isRunning() && game.getCurrentPlayer() == 1 && !game.isShowingInfo() && !playerHasDrawn)
{ {
playerHasDrawn = true;
Card drawedCard = game.getDeck().drawCard(game.getDeadDeck()); Card drawedCard = game.getDeck().drawCard(game.getDeadDeck());
ArrayList<Card> allCards = new ArrayList<Card>(); ArrayList<Card> allCards = new ArrayList<Card>();
allCards.add(drawedCard); allCards.add(drawedCard);
...@@ -637,6 +640,7 @@ public class Controller ...@@ -637,6 +640,7 @@ public class Controller
game.getPlayer().drawCard(cards.get(drawCounter)); game.getPlayer().drawCard(cards.get(drawCounter));
setPlayerDeck(game.getPlayer().getDeck()); setPlayerDeck(game.getPlayer().getDeck());
drawCounter++; drawCounter++;
playerHasDrawn = false;
if(drawCounter < cards.size()) if(drawCounter < cards.size())
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment