Exemplo n.º 1
0
        public DeckRegularDict <D> DrawSeveralCards(int howMany, bool showErrors = true)
        {
            if (_objectList.Count < howMany && showErrors)
            {
                throw new BasicBlankException("Not enough cards to draw.  Needs at least " + howMany + ".  There are " + _objectList.Count + " cards left");
            }
            else if (_objectList.Count < howMany)
            {
                howMany = _objectList.Count;
            }
            DeckRegularDict <D> TempList = _objectList.Take(howMany).ToRegularDeckDict();

            _objectList.RemoveGivenList(TempList, NotifyCollectionChangedAction.Remove); //try this way.  so the event happens once, and not several times.
            TempList.MakeAllObjectsKnown();
            return(TempList);
        }