예제 #1
0
        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
 private void Copy(PokerPlayer player)
 {
     this.Name        = player.Name;
     this.CardsOnHand = player.CardsOnHand;
 }