コード例 #1
0
        public override string ToString()
        {
            string hand1String = Hand1.ToString();
            string hand2String = Hand2.ToString();
            string dealString  = $"{hand1String} {hand2String}";

            return(dealString);
        }
コード例 #2
0
        public static bool operator !=(Hand Hand1, Hand Hand2)
        {
            if (Hand1.IsValid() && Hand2.IsValid())
            {
                if (Hand1.Mask != Hand2.Mask)
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
        public bool IsHand1Winner()
        {
            PokerHandType pokerHandType1 = Hand1.GetPokerHandType();
            PokerHandType pokerHandType2 = Hand2.GetPokerHandType();

            if (pokerHandType1 > pokerHandType2)
            {
                return(true);
            }

            if (pokerHandType1 < pokerHandType2)
            {
                return(false);
            }

            return(IsHand1WinnerWhereBothHandsHaveSamePokerType(pokerHandType1));
        }
コード例 #4
0
        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();
        }
コード例 #5
0
ファイル: Machine.cs プロジェクト: jaynguyen89/AutoJack
 internal void AddHand1(Card Card)
 {
     Hand1.Add(Card);
 }