コード例 #1
0
ファイル: PokerHand.cs プロジェクト: ledorali/PokerGameExam
        public void Arrange(PokerPlayer player)
        {
            this.Copy(player);
            if (CheckIsRoyalFlush())
            {
                this.Category = HandCategory.RoyalFlush;
            }
            else if (CheckIsFourOfAKind())
            {
                this.Category = HandCategory.FourOfAKind;
            }
            else if (CheckIsStraightFlush())
            {
                this.Category = HandCategory.StraightFlush;
            }
            else if (CheckIsFullHouse())
            {
                this.Category = HandCategory.FullHouse;
            }
            else if (CheckIsFlush())
            {
                this.Category = HandCategory.Flush;
            }
            else if (CheckIsStraight())
            {
                this.Category = HandCategory.Straight;
            }
            else if (CheckIsThreeOfAKind())
            {
                this.Category = HandCategory.ThreeOfaKind;
            }
            else if (CheckIsTwoPair())
            {
                this.Category = HandCategory.TwoPair;
            }
            else if (CheckIsPair())
            {
                this.Category = HandCategory.OnePair;
            }
            else
            {
                this.Category = HandCategory.HighCard;
            }

            //Get Score to get High Card
            this.Score = this.CardsOnHand.AsEnumerable().Sum(r => (int)r.Rank);
        }
コード例 #2
0
 public override void GivePlayingCards(PokerPlayer player, PlayingCard card)
 {
     player.ReceivePlayingCard(card);
 }
コード例 #3
0
 public abstract void AddPlayer(PokerPlayer player);
コード例 #4
0
 public abstract void GivePlayingCards(PokerPlayer player, PlayingCard card);
コード例 #5
0
ファイル: PokerHand.cs プロジェクト: ledorali/PokerGameExam
 private void Copy(PokerPlayer player)
 {
     this.Name        = player.Name;
     this.CardsOnHand = player.CardsOnHand;
 }