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); } }
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); }
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); }
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); }
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); }
public Card PlayCard(Trick currentTrick) { //TODO Implement playing card logic return(null); //_handOfCards.First(x=> currentTrick.IsCardPlayable(this, x)); }
public Card PlayCard(Trick currentTrick) { //TODO Implement playing card logic return null; //_handOfCards.First(x=> currentTrick.IsCardPlayable(this, x)); }