Class Deck

java.lang.Object
ca.uqam.info.model.Deck

public class Deck extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static class 
    Inner Class NodeCard Helper for create a stack
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the Deck.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Helper method to concatenate all the list of split to the deck
    int
    Getter to look up how many card present in the deck
    boolean
    Getter to know if the deck is empty
    void
    Helper method to create new set of skyjo card game
    Helper method to peek a card from the deck
    pop()
    Helper method to pop a card from the deck
    void
    push(ca.uqam.info.mgl7010.max.skyjo.model.Card card)
    Helper method to push a card to the deck
    void
    Helper method to shuffle a deck of card

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public CardImpl pop()
      Helper method to pop a card from the deck
      Returns:
      Cartes
    • peek

      public CardImpl peek()
      Helper method to peek a card from the deck
      Returns:
      Cartes
    • shuffle

      public void shuffle()
      Helper method to shuffle a deck of card
    • concatenateDeck

      public void concatenateDeck(Deck deck)
      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