예제 #1
0
        public static PokerAction GetActionForUnsuitedCards(Card higherCard, Card lowerCard)
        {
            switch (higherCard.Rank)
            {
            case Rank.Ace:
                return(PokerAction.Call);

            case Rank.King:
                return((int)lowerCard.Rank >= 6 ? PokerAction.Call : PokerAction.Fold);

            case Rank.Queen:
                return((int)lowerCard.Rank >= 7 ? PokerAction.Call : PokerAction.Fold);

            case Rank.Jack:
                return((int)lowerCard.Rank >= 8 ? PokerAction.Call : PokerAction.Fold);

            case Rank._10:
                return((int)lowerCard.Rank >= 7 ? PokerAction.Call : PokerAction.Fold);

            case Rank._9:
                return((int)lowerCard.Rank >= 7 ? PokerAction.Call : PokerAction.Fold);

            case Rank._8:
                return((int)lowerCard.Rank >= 7 ? PokerAction.Call : PokerAction.Fold);

            case Rank._7:
                return((int)lowerCard.Rank >= 7 ? PokerAction.Call : PokerAction.Fold);

            case Rank._6:
                return((int)lowerCard.Rank >= 6 ? PokerAction.Call : PokerAction.Fold);

            case Rank._5:
                return((int)lowerCard.Rank >= 5 ? PokerAction.Call : PokerAction.Fold);

            case Rank._4:
                return((int)lowerCard.Rank >= 4 ? PokerAction.Call : PokerAction.Fold);

            case Rank._3:
                return((int)lowerCard.Rank >= 3 ? PokerAction.Call : PokerAction.Fold);

            case Rank._2:
                return((int)lowerCard.Rank >= 2 ? PokerAction.Call : PokerAction.Fold);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
예제 #2
0
 public static PokerAction GetActionBasendOnHandCards(Card higherCard, Card lowerCard)
 {
     return(higherCard.Color == lowerCard.Color ? GetActionForSuitedCards(higherCard, lowerCard) : GetActionForUnsuitedCards(higherCard, lowerCard));
 }