Пример #1
0
        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);
            }
        }