Exemplo n.º 1
0
        private void DealCards(List <IPlayer> players)
        {
            bool missingTrump = true;

            while (missingTrump)
            {
                IDeck Deck        = new Piquet();
                int   timesAround = Deck.Cards.Count / players.Count;

                for (int i = 0; i < timesAround; ++i)
                {
                    foreach (IPlayer player in players)
                    {
                        player.AddToHand(Deck.GetTopCard());
                    }
                }
                Blind.AddCard(Deck.GetTopCard());
                Blind.AddCard(Deck.GetTopCard());

                players.ForEach(player =>
                {
                    missingTrump &= !player.Hand.Cards.Aggregate(false, (agg, card) => agg || card.IsTrump());
                });
                // If nobody got trump, wipe the hands and blind and start again
                if (missingTrump)
                {
                    players.ForEach(player =>
                    {
                        player.Hand = new Hand.Hand();
                    });
                    Blind = new Blind.Blind();
                }
            }
        }
Exemplo n.º 2
0
 public Game()
 {
     Rounds      = new List <IRound>();
     IsCracked   = false;
     Blind       = new Blind.Blind();
     PartnerCard = new Card.Card(CardID.Jack, CardPower.JackDiamond, Suit.Diamond);
 }