public void ClearPiles()
 {
     _previouslyPlayed.Clear();
     CardPiles.ClearBoard();
     SafetyList.Clear();
     CurrentCard   = null;
     HowMany200S   = 0;
     Miles         = 0;
     Wrongs        = 0;
     CurrentHazard = EnumHazardType.None;
     CurrentSpeed  = false;
     Update200Data();
 }
Esempio n. 2
0
        public virtual void ClearBoard(IDeckDict <SolitaireCard> thisList)
        {
            if (thisList.Count != CardsNeededToBegin)
            {
                throw new BasicBlankException($"Needs {CardsNeededToBegin} not {thisList.Count}");
            }
            _score.Score = thisList.Count;
            if (CardsNeededToBegin != Rows * Columns && CardsNeededToBegin != 0 && IsRound == false)
            {
                throw new BasicBlankException($"Since there are no 0 cards needed; then needs {Rows * Columns}, not {CardsNeededToBegin}");
            }
            else if (IsRound && CardsNeededToBegin != 1)
            {
                throw new BasicBlankException("When its round suits; needs only one card to begin with");
            }
            else if (IsRound && thisList.Count != 1)
            {
                throw new BasicBlankException("When its round; needs to have exactly one card to begin with");
            }
            int y = 2;

            Piles.PileList !.ForEach(thisPile =>
            {
                if (ShowNextNeeded)
                {
                    thisPile.Text = y.ToString();
                }
                y += 2;
            });
            Piles.ClearBoard();
            if (thisList.Count == 0)
            {
                return;
            }
            int x = 0;

            foreach (var thisPile in Piles.PileList)
            {
                thisPile.ObjectList.Add(thisList[x]);
                x++;
                if (IsRound)
                {
                    return;
                }
            }
        }