import Foundation

enum Deck {
    /// Creates a standard 52-card deck, shuffled.
    static func standard() -> [Card] {
        var cards: [Card] = []
        for suit in Suit.allCases {
            for rank in Rank.allCases {
                cards.append(Card(suit: suit, rank: rank))
            }
        }
        cards.shuffle()
        return cards
    }

    /// Creates a double deck (104 cards) for Spider solitaire, shuffled.
    static func double() -> [Card] {
        var cards: [Card] = []
        for _ in 0..<2 {
            for suit in Suit.allCases {
                for rank in Rank.allCases {
                    cards.append(Card(suit: suit, rank: rank))
                }
            }
        }
        cards.shuffle()
        return cards
    }
}
