public override string ToString() { string hand1String = Hand1.ToString(); string hand2String = Hand2.ToString(); string dealString = $"{hand1String} {hand2String}"; return(dealString); }
public static bool operator !=(Hand Hand1, Hand Hand2) { if (Hand1.IsValid() && Hand2.IsValid()) { if (Hand1.Mask != Hand2.Mask) { return(true); } } return(false); }
public bool IsHand1Winner() { PokerHandType pokerHandType1 = Hand1.GetPokerHandType(); PokerHandType pokerHandType2 = Hand2.GetPokerHandType(); if (pokerHandType1 > pokerHandType2) { return(true); } if (pokerHandType1 < pokerHandType2) { return(false); } return(IsHand1WinnerWhereBothHandsHaveSamePokerType(pokerHandType1)); }
public void StartGame() { var rand = new Random(); SetUpEntities(rand); Turn = true; while (Hand1.Cards.Count > 0 && Hand2.Cards.Count > 0 && Deck.Cards.Count > 0) { if (Turn) { Hand1.PlayTurn(Hand2, Deck, rand); } else { Hand2.PlayTurn(Hand1, Deck, rand); } Turn = !Turn; } DeclareWinner(); }
internal void AddHand1(Card Card) { Hand1.Add(Card); }