pub fn add_to_deck(deck: &mut Vec<Card>, card: Unit, player: u8) {
        let values = Card::get_values(card);

        for i in 0..4 {
            if player == 1 {
                deck.push(Card {
                    name: card,
                    top: values[(0 + (4 - i)) % 4],
                    right: values[(1 + (4 - i)) % 4],
                    bottom: values[(2 + (4 - i)) % 4],
                    left: values[(3 + (4 - i)) % 4],
                    player,
                });
            } else {
                // player 2 uses mirrored cards
                let mut card = Card {
                    name: card,
                    top: values[(0 + i) % 4],
                    right: values[(1 + i) % 4],
                    bottom: values[(2 + i) % 4],
                    left: values[(3 + i) % 4],
                    player,
                };

                swap(&mut card.left, &mut card.right);

                deck.push(card);
            }
        }
    }
// adds a card stack (4 cards) of the specified type to the deck
adds a card stack (4 cards) of the specified type to the deck
adds a card stack ( 4 cards ) of the specified type to the deck
pub fn add_to_deck(deck: &mut Vec<Card>, card: Unit, player: u8) {
        let values = Card::get_values(card);
        for i in 0..4 {
            if player == 1 {
                deck.push(Card {
                    name: card,
                    top: values[(0 + (4 - i)) % 4],
                    right: values[(1 + (4 - i)) % 4],
                    bottom: values[(2 + (4 - i)) % 4],
                    left: values[(3 + (4 - i)) % 4],
                    player,
                });
            } else {
                // player 2 uses mirrored cards
                let mut card = Card {
                    name: card,
                    top: values[(0 + i) % 4],
                    right: values[(1 + i) % 4],
                    bottom: values[(2 + i) % 4],
                    left: values[(3 + i) % 4],
                    player,
                };
                swap(&mut card.left, &mut card.right);
                deck.push(card);
            }
        }
    }
pub fn add_to_deck ( deck : & mut Vec < Card > , card : Unit , player : u8 ) { let values = Card :: get_values ( card ) ; for i in 0 .. 4 { if player == 1 { deck . push ( Card { name : card , top : values [ ( 0 + ( 4 - i ) ) % 4 ] , right : values [ ( 1 + ( 4 - i ) ) % 4 ] , bottom : values [ ( 2 + ( 4 - i ) ) % 4 ] , left : values [ ( 3 + ( 4 - i ) ) % 4 ] , player , } ) ; } else { // player 2 uses mirrored cards let mut card = Card { name : card , top : values [ ( 0 + i ) % 4 ] , right : values [ ( 1 + i ) % 4 ] , bottom : values [ ( 2 + i ) % 4 ] , left : values [ ( 3 + i ) % 4 ] , player , } ; swap ( & mut card . left , & mut card . right ) ; deck . push ( card ) ; } } }
adds a card stack (4 cards) of the specified type to the deck
adds a card stack ( 4 cards ) of the specified type to the deck
deck
&mut Vec<Card>
card
Unit
player
u8