コード例 #1
0
ファイル: ScoreModel.cs プロジェクト: svavar/Multi-View-Poker
        public bool HasThisHand(Hand hand)
        {
            var x = from c in hand.Cards where c.Suit != hand.Cards[0].Suit select c;

            if (x.Count() > 0)
                return false;

            return true;
        }
コード例 #2
0
ファイル: ScoreModel.cs プロジェクト: svavar/Multi-View-Poker
        public bool HasThisHand(Hand hand)
        {
            ThreeOfAKind threeOfAKind = new ThreeOfAKind();
            OnePair onePair = new OnePair();

            return threeOfAKind.HasThisHand(hand) && onePair.HasThisHand(hand);
        }
コード例 #3
0
ファイル: ScoreModel.cs プロジェクト: svavar/Multi-View-Poker
        public bool HasThisHand(Hand hand)
        {
            int pairCount = 0;
            foreach (Faces face in hand.Histogram.Keys)
            {
                if (hand.Histogram[face] == 2)
                    pairCount++;
            }

            return pairCount == 2;
        }
コード例 #4
0
ファイル: ScoreModel.cs プロジェクト: svavar/Multi-View-Poker
        public bool HasThisHand(Hand hand)
        {
            foreach (Faces face in hand.Histogram.Keys)
            {
                if (hand.Histogram[face] == 3)
                    return true;
            }

            return false;
        }
コード例 #5
0
ファイル: ScoreModel.cs プロジェクト: svavar/Multi-View-Poker
        public bool HasThisHand(Hand hand)
        {
            Flush flush = new Flush();
            Straight straight = new Straight();

            return flush.HasThisHand(hand) && straight.HasThisHand(hand);
        }
コード例 #6
0
ファイル: ScoreModel.cs プロジェクト: svavar/Multi-View-Poker
        public bool HasThisHand(Hand hand)
        {
            if (hand.Cards[0].Face == hand.Cards[1].Face - 1
                && hand.Cards[1].Face == hand.Cards[2].Face - 1
                && hand.Cards[2].Face == hand.Cards[3].Face - 1
                && hand.Cards[3].Face == hand.Cards[4].Face - 1)
            {
                return true;
            }

            return false;
        }