Example #1
0
        public void PlayTricks()
        {
            for (int i = 0; i < 13; i++)
            {
                //TODO The lead should change here based off of the person who took the trick
                var trick = new Trick(this);

                trick.PlayTrick();

                AddTrick(trick);
            }
        }
Example #2
0
        public void DifferentSuitsNoTrumpsGetWinningPlayerTest()
        {
            var trick = new Trick(new Hand(Players, Deck) { SpadesHaveBeenBroken = true });
            trick.PlayCard(PlayerOne, new Card() { Rank = Rank.Seven, Suit = Suit.Clubs });
            trick.PlayCard(PlayerTwo, new Card() { Rank = Rank.Ten, Suit = Suit.Hearts });
            trick.PlayCard(PlayerThree, new Card() { Rank = Rank.Two, Suit = Suit.Clubs });
            trick.PlayCard(PlayerFour, new Card() { Rank = Rank.Nine, Suit = Suit.Diamonds });

            var winner = trick.GetWinningPlayer();

            Assert.AreEqual(PlayerOne, winner);
        }
Example #3
0
        public void AllTrumpsGetWinningPlayerTest()
        {
            var trick = new Trick(new Hand(Players, Deck) { SpadesHaveBeenBroken = true });

            trick.PlayCard(PlayerTwo, new Card() { Rank = Rank.King, Suit = Suit.Spades });
            trick.PlayCard(PlayerThree, new Card() { Rank = Rank.Queen, Suit = Suit.Spades });
            trick.PlayCard(PlayerFour, new Card() { Rank = Rank.Jack, Suit = Suit.Spades });
            trick.PlayCard(PlayerOne, new Card() { Rank = Rank.Ace, Suit = Suit.Spades });

            var winner = trick.GetWinningPlayer();

            Assert.AreEqual(PlayerOne, winner);
        }
Example #4
0
        public void AddTrick(Trick trick)
        {
            if (Tricks.Count == 13)
            {
                throw new Exception("Then hand is over why are there still tricks?");
            }

            if(trick.PlayedCards.Any(x=> x.Value.Suit == Suit.Spades))
            {
                SpadesHaveBeenBroken = true;
            }

            //TODO: Figure out who won the hand and increment the trick count
            Tricks.Add(trick);
        }
Example #5
0
        public void AddTrick(Trick trick)
        {
            if (Tricks.Count == 13)
            {
                throw new Exception("Then hand is over why are there still tricks?");
            }

            if (trick.PlayedCards.Any(x => x.Value.Suit == Suit.Spades))
            {
                SpadesHaveBeenBroken = true;
            }

            //TODO: Figure out who won the hand and increment the trick count
            Tricks.Add(trick);
        }
Example #6
0
 public Card PlayCard(Trick currentTrick)
 {
     //TODO Implement playing card logic
     return(null); //_handOfCards.First(x=> currentTrick.IsCardPlayable(this, x));
 }
Example #7
0
        public void PlayTricks()
        {
            for (int i = 0; i < 13; i++)
            {
                //TODO The lead should change here based off of the person who took the trick
                var trick = new Trick(this);

                trick.PlayTrick();

                AddTrick(trick);
            }
        }
Example #8
0
 public Card PlayCard(Trick currentTrick)
 {
     //TODO Implement playing card logic
     return null; //_handOfCards.First(x=> currentTrick.IsCardPlayable(this, x));
 }