示例#1
0
文件: Hand.cs 项目: ccarlsson/Poker
        public void Add(Card card)
        {
            if (_cards.Count >= 5)
            {
                throw new IndexOutOfRangeException("Cannot add more then five cards.");
            }

            _cards.Add(card);

            if (_cards.Count == 5)
            {
                Rank = HandCategorizerChain.GetRank(this);
            }
        }
示例#2
0
        public void Add(Card card)
        {
            if (_cards.Count == 5)
            {
                throw new InvalidOperationException("Cannot add more than 5 cards to a hand.");
            }

            _cards.Add(card);

            if (_cards.Count == 5)
            {
                _rank = HandCategorizerChain.GetRank(this);
            }
        }