Class Deck
java.lang.Object
ca.uqam.info.model.Deck
Custom data structure implementation for Skyjo deck.
Uses a stack approach without Java collections.
This class represents the main deck of Skyjo cards and provides
stack-like operations (push, pop, peek) for card management.
The deck is implemented as stack to avoid using
Java's built-in collection classes as required by the project constraints.
The deck automatically initializes with the complete set of Skyjo cards
according to official game rules and shuffles them upon creation.
- Version:
- 1.3
- Author:
- Mohamed Latif Diallo, Hamza Afif, Ussel Sabbat
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner Class NodeCard Helper for create a stack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconcatenateDeck(Deck deck) Helper method to concatenate all the list of split to the deckintgetSize()Getter to look up how many card present in the deckbooleanisEmpty()Getter to know if the deck is emptyvoidHelper method to create new set of skyjo card gamepeek()Helper method to peek a card from the deckpop()Helper method to pop a card from the deckvoidpush(ca.uqam.info.mgl7010.max.skyjo.model.Card card) Helper method to push a card to the deckvoidshuffle()Helper method to shuffle a deck of card
-
Constructor Details
-
Deck
public Deck()Constructor for the Deck.
-
-
Method Details
-
push
public void push(ca.uqam.info.mgl7010.max.skyjo.model.Card card) Helper method to push a card to the deck- Parameters:
card- as card
-
pop
-
peek
-
shuffle
public void shuffle()Helper method to shuffle a deck of card -
concatenateDeck
Helper method to concatenate all the list of split to the deck- Parameters:
deck- as list of deck to split shuffle card
-
loadSkijoCard
public void loadSkijoCard()Helper method to create new set of skyjo card game -
isEmpty
public boolean isEmpty()Getter to know if the deck is empty- Returns:
- boolean
-
getSize
public int getSize()Getter to look up how many card present in the deck- Returns:
- size of the deck
-