Skip to content
Snippets Groups Projects
Commit de5067cb authored by Torbjørn Antonsen's avatar Torbjørn Antonsen
Browse files

Merge branch 'feat/GUI' into 'main'

implemented checkHand functions to check hand button

See merge request !7
parents 69ef4541 cfa0dea6
No related branches found
No related tags found
1 merge request!7implemented checkHand functions to check hand button
......@@ -17,11 +17,9 @@ public class DeckOfCards {
}
}
<<<<<<< Updated upstream
public PlayingCard[] dealHand(int n) {
=======
public void dealHand(HandOfCards handOfCards, int n) {
>>>>>>> Stashed changes
List<PlayingCard> drawDeck = deckOfCards;
List<PlayingCard> hand = new ArrayList<>();
Random random = new Random();
......@@ -33,12 +31,7 @@ public class DeckOfCards {
hand.add(drawDeck.get(i));
drawDeck.remove(i);
}
<<<<<<< Updated upstream
return hand;
=======
handOfCards.setHand(hand);
>>>>>>> Stashed changes
}
public List<PlayingCard> getDeckOfCards() {
......
......@@ -21,8 +21,10 @@ class DeckOfCardsTest {
@Test
public void dealHandDealsRightAmountOfCards() {
DeckOfCards doc = new DeckOfCards();
assertEquals(5, doc.dealHand(5).length);
}
HandOfCards hoc = new HandOfCards();
doc.dealHand(hoc,5);
assertEquals(5, hoc.getHand().size());
}
}
\ No newline at end of file
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment