Package project2
Class Deck
java.lang.Object
project2.Deck
Title: The Deck class
Description: This class represents a Deck of 52 playing cards. It gets created in order and then must be shuffled to randomize the order of the cards. Cards are dealt from the top of the deck.
- Author:
- NCC CS1 Professors
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondealCard()dealCard -- deals the top card from the deck and decreases the number of cards in the deck by 1voidPlaces the cards in the deck in a random ordervoidshuffleDeck(int seed) Places the cards in the deck in a random order
-
Constructor Details
-
Deck
public Deck()default constructor which creates the deck of 52 cards in order
-
-
Method Details
-
shuffleDeck
public void shuffleDeck()Places the cards in the deck in a random order -
shuffleDeck
public void shuffleDeck(int seed) Places the cards in the deck in a random order- Parameters:
seed- Seed for the random number generator
-
dealCard
dealCard -- deals the top card from the deck and decreases the number of cards in the deck by 1- Returns:
- a reference to the Card being dealt
-