Beispiel #1
0
        public static void CalculateTie(Game game)
        {
            TypeOfHand typeOfHand = game.Player1.HandPlayed.Type;

            switch (typeOfHand)
            {
            case TypeOfHand.Flush:
            case TypeOfHand.FullHouse:
            case TypeOfHand.TwoPairs:
            case TypeOfHand.OnePair:
            case TypeOfHand.NoHand:
            {
                GetWinnerByHighestCard(game);
                break;
            }

            case TypeOfHand.ThreeOfAKind:
            case TypeOfHand.FourOfAKind:
            {
                GetculateWinnerSameCardNumbers(game);
                break;
            }

            default:
                break;
            }
            if (typeOfHand == TypeOfHand.Flush || typeOfHand == TypeOfHand.FullHouse || typeOfHand == TypeOfHand.OnePair || typeOfHand == TypeOfHand.TwoPairs)
            {
                GetWinnerByHighestCard(game);
            }
            if (typeOfHand == TypeOfHand.ThreeOfAKind || typeOfHand == TypeOfHand.FourOfAKind)
            {
                GetculateWinnerSameCardNumbers(game);
            }
        }
Beispiel #2
0
        public Hand(TypeOfHand type, List <Card> cards)
        {
            Type = type;

            if (cards == null)
            {
                throw new ArgumentNullException("cards");
            }
            if (cards.Count != 5)
            {
                throw new ArgumentException("cards");
            }
            Cards = new List <Card>(cards);
        }
Beispiel #3
0
 public HandToPlay(TypeOfHand handType, List <Card> cardsToPlay)
 {
     m_type  = handType;
     m_cards = cardsToPlay;
 }