Class LeaderCardDeck

java.lang.Object
it.polimi.ingsw.model.leadercard.LeaderCardDeck

public class LeaderCardDeck
extends java.lang.Object
Represents the deck of leader cards before they are distributed to the players
  • Constructor Summary

    Constructors
    Constructor Description
    LeaderCardDeck()  
  • Method Summary

    Modifier and Type Method Description
    java.util.List<LeaderCard> drawFourCards()
    draws 4 cards from the deck and returns them as a list
    LeaderCard getCardFromId​(int id)
    get the leaderCard corresponding to the specified Id
    void shuffleLeaderList()
    Randomly permutes leaderCards in the deck

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LeaderCardDeck

      public LeaderCardDeck()
  • Method Details

    • shuffleLeaderList

      public void shuffleLeaderList()
      Randomly permutes leaderCards in the deck
    • drawFourCards

      public java.util.List<LeaderCard> drawFourCards()
      draws 4 cards from the deck and returns them as a list
      Returns:
      the 4 drawn cards
    • getCardFromId

      public LeaderCard getCardFromId​(int id) throws InvalidCardException
      get the leaderCard corresponding to the specified Id
      Parameters:
      id - Id of the leaderCard to get
      Returns:
      the the leaderCard corresponding to the specified Id
      Throws:
      InvalidCardException - if there isn't a card with the specified id in the deck