Esempio n. 1
0
        public void AddSeveralCards(IDeckDict <D> whatList)
        {
            if (whatList.Count == 0)
            {
                return;
            }
            DeckRegularDict <D> newList = new DeckRegularDict <D>();

            if (CurrentCard.Deck > 0)
            {
                newList.Add(CurrentCard);
            }
            CurrentCard            = whatList.Last();
            CurrentCard.IsUnknown  = false;
            CurrentCard.IsSelected = false;
            CurrentCard.Drew       = false;
            int x;

            for (x = whatList.Count - 1; x >= 1; x += -1)
            {
                whatList[x - 1].IsSelected = false;
                whatList[x - 1].Drew       = false; // i think
                newList.Add(whatList[x - 1]);
            }
            _objectList.AddRange(newList);
            _previousNum = _objectList.Count; // i think
        }
        protected override DeckObservableDict <MilkRunCardInformation> GetReshuffleList()
        {
            DeckObservableDict <MilkRunCardInformation> output = new DeckObservableDict <MilkRunCardInformation>();
            var tempList = _model !.Pile1 !.FlipCardList();
            int x;

            for (x = 1; x <= 3; x++)
            {
                if (x > tempList.Count)
                {
                    break;
                }
                output.Add(tempList[x - 1]);
            }
            PlayerList !.ForEach(thisPlayer =>
            {
                output.AddRange(thisPlayer.GetPileCardList());
            });
            DeckObservableDict <MilkRunCardInformation> finalList = new DeckObservableDict <MilkRunCardInformation>();

            _gameContainer.DeckList !.ForEach(thisCard =>
            {
                if (output.Contains(thisCard) == false)
                {
                    finalList.Add(thisCard);
                }
            });
            return(finalList);
        }
Esempio n. 3
0
 public void ShuffleInExtraCards(IDeckDict <D> extraCards) //this is needed for games like life card game where some cards can't be in hand but must be in deck.
 {
     foreach (var thisCard in extraCards)
     {
         if (DeckStyle == EnumStyleType.AlwaysKnown)
         {
             thisCard.IsUnknown = false;
         }
         else
         {
             thisCard.IsUnknown = true;
         }
     }
     _objectList.AddRange(extraCards);
     _objectList.ShuffleList();//i think we need this too.
 }