void ILoadActionProcesses.LoadDoAgainCards()
        {
            _actionContainer.ActionCategory = EnumActionCategory.DoAgain;
            var firstList = _model.Pile1 !.DiscardList();
            DeckRegularDict <FluxxCardInformation> secondList = new DeckRegularDict <FluxxCardInformation>();

            firstList.ForEach(x =>
            {
                if (x.Deck == 0)
                {
                    throw new BasicBlankException("Deck cannot be 0 for load action again.  Rethink");
                }
                var card = FluxxDetailClass.GetNewCard(x.Deck);
                card.Populate(x.Deck); //maybe this is needed too.
                secondList.Add(card);
            });
            var tempList = secondList.Where(items => items.CanDoCardAgain()).Select(items => items.Text()).ToCustomBasicList();

            if (tempList.Count == 0)
            {
                throw new BasicBlankException("Must have at least one card to do again.  Otherwise; can't do again");
            }
            _actionContainer.IndexCard = -1;
            _actionContainer.CardList1 !.LoadTextList(tempList);
        }
Exemple #2
0
        protected DeckRegularDict <SolitaireCard> GetAceList()
        {
            var output = CardList.Where(items => items.Value == EnumCardValueList.LowAce || items.Value == EnumCardValueList.HighAce).ToRegularDeckDict();

            CardList !.RemoveGivenList(output);
            return(output);
        }
        private DeckRegularDict <MonasteryCardInfo> PopulateTempCol(DeckRegularDict <MonasteryCardInfo> thisCol, out DeckRegularDict <MonasteryCardInfo> aceList)
        {
            aceList = thisCol.Where(items => items.Value == EnumCardValueList.LowAce || items.Value == EnumCardValueList.HighAce).ToRegularDeckDict();
            DeckRegularDict <MonasteryCardInfo> output = thisCol.ToRegularDeckDict();

            output.RemoveGivenList(aceList, System.Collections.Specialized.NotifyCollectionChangedAction.Remove);
            return(output); //hopefully this works.
        }
Exemple #4
0
        public bool IsKinds(DeckRegularDict <TileInfo> thisList)
        {
            if (thisList.Count > 4)
            {
                return(false);
            }
            var temps = thisList.Where(items => items.IsJoker == false).ToRegularDeckDict();
            var count = temps.DistinctCount(items => items.Color);

            if (count != temps.Count)
            {
                return(false);                                       //because has to have different colors.
            }
            return(temps.DistinctCount(items => items.Number) == 1); //if its one, then its okay.  otherwise, its not.
        }