java.lang.Object
polimi.ingsw.am21.codex.model.Cards.Commons.Deck<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of cards left in the deckdraw()
Draws a card from the deckdraw
(int n) Draws a card from the deckvoid
Inserts a card in the bottom of the deckpeek()
Lets you peek the top card of the deck, without removing itvoid
shuffle()
Shuffles the deck
-
Constructor Details
-
Deck
- Parameters:
cards
- list of cards
-
-
Method Details
-
shuffle
public void shuffle()Shuffles the deck -
draw
Draws a card from the deck- Returns:
- the card drawn
- Throws:
EmptyDeckException
-
draw
Draws a card from the deck- Parameters:
n
- number of cards to draw- Returns:
- the list of drawn cards
- Throws:
EmptyDeckException
-
cardsLeft
public int cardsLeft()Returns the number of cards left in the deck -
insert
Inserts a card in the bottom of the deck- Parameters:
card
- the card to insert
-
peek
Lets you peek the top card of the deck, without removing it- Returns:
- The top card of the deck
-