Browse Source

implement FaceDown to Game.java

main
fdai7793 11 months ago
parent
commit
fa81f24f0e
  1. 4
      src/main/java/de/hsfulda/onses/models/Game.java

4
src/main/java/de/hsfulda/onses/models/Game.java

@ -31,7 +31,7 @@ public class Game {
} }
public Game setLastPlayedCard(Card lastPlayedCard) { public Game setLastPlayedCard(Card lastPlayedCard) {
final Card oldLastPlayedCard = this.lastPlayedCard; final Card oldLastPlayedCard = this.lastPlayedCard;
this.lastPlayedCard = lastPlayedCard;
this.lastPlayedCard = lastPlayedCard.setFacedown(false);
this.firePropertyChange(PROPERTY_LAST_PLAYED_CARD, oldLastPlayedCard, lastPlayedCard); this.firePropertyChange(PROPERTY_LAST_PLAYED_CARD, oldLastPlayedCard, lastPlayedCard);
return this; return this;
} }
@ -42,7 +42,7 @@ public class Game {
public void addCardToDrawCardDeck(Card card) { public void addCardToDrawCardDeck(Card card) {
final ArrayList<Card> oldCards = new ArrayList<>(this.drawCardDeck); final ArrayList<Card> oldCards = new ArrayList<>(this.drawCardDeck);
drawCardDeck.add(card);
drawCardDeck.add(card.setFacedown(true));
this.firePropertyChange(PROPERTY_DRAW_CARD_DECK, oldCards, drawCardDeck); this.firePropertyChange(PROPERTY_DRAW_CARD_DECK, oldCards, drawCardDeck);
} }

Loading…
Cancel
Save