public MainWindow() { InitializeComponent(); _dealer = new Deck(new Game()); }
public DeckShape GetDeckShape(Deck deck) { for (int i = 0; i < DeckShapes.Count; i++) { if (DeckShapes[i].Deck == deck) return DeckShapes[i]; } return null; }
private void Start_Click(object sender, RoutedEventArgs e) { _dealer = new Deck(1, 13, GameShape.Game); _dealer.Shuffle(5); _dealer.MakeAllCardsDragable(false); _dealer.Enabled = true; _dealer.FlipAllCards(); var pbn = Pbn.Text; // collection cards if any are out if (_dealer.Cards.Count < 52) { CollectCards(); } _dealer.Shuffle(5); // deal 13 cards to each of the four players for (var cardCount = 0; cardCount < CardsPerPlayer; cardCount++) { _dealer.Draw(Player1Hand.Deck, 1); _dealer.Draw(Player2Hand.Deck, 1); _dealer.Draw(Player3Hand.Deck, 1); _dealer.Draw(Player4Hand.Deck, 1); } // turn over human player [4] hand Player4Hand.Deck.Sort(); Player4Hand.Deck.MakeAllCardsDragable(true); Player4Hand.Deck.FlipAllCards(); }
/// <summary> /// Draws/Moves the specified amount of cards to the specified deck. /// </summary> /// <param name="toDeck">To deck.</param> /// <param name="count">The count.</param> public void Draw(Deck toDeck, int count) { for (var i = 0; i < count; i++) { TopCard.Deck = toDeck; } }