protected override void AfterPopulateObjects()
 {
     HandList.ForEach(thisCard =>
     {
         AddObjectToHand(thisCard); //even better.
     });
 }
Ejemplo n.º 2
0
        public DeckRegularDict <RegularRummyCard> DiscardListSelected(int deck)
        {
            if (deck == 0)
            {
                throw new BasicBlankException("Deck cannot be 0 for the discard selected.  Rethink");
            }
            DeckRegularDict <RegularRummyCard> output = new DeckRegularDict <RegularRummyCard>();
            bool didStart = false;

            HandList.ForEach(thisCard =>
            {
                if (thisCard.Deck == deck)
                {
                    didStart = true;
                }
                if (didStart == true)
                {
                    output.Add(thisCard);
                }
            });
            if (output.Count == 0)
            {
                throw new BasicBlankException("No cards for discard list.  Rethink");
            }
            return(output);
        }
Ejemplo n.º 3
0
 public void RefreshCards()
 {
     if (ThisScroll == null)
     {
         return;
     }
     HandList.ForEach(thisCard => thisCard.Visible = CanPositionCard(thisCard));
     ThisScroll.RecalculatePositioning();
 }
Ejemplo n.º 4
0
 protected override void AfterPopulateObjects()
 {
     HandList.ForEach(thisCard =>
     {
         thisCard.Visible    = true;
         thisCard.Drew       = false;
         thisCard.IsSelected = false;
         thisCard.IsUnknown  = false;
     });
 }
 public override void EndTurn()
 {
     HandList.ForEach(thisTile =>
     {
         if (thisTile.WhatDraw != EnumDrawType.FromSet)
         {
             thisTile.WhatDraw = EnumDrawType.IsNone;
         }
         thisTile.IsSelected = false;
     });
 }
Ejemplo n.º 6
0
        public void SelectPastPoint(int deck)
        {
            bool starts = false;

            HandList.ForEach(thisCard =>
            {
                if (thisCard.Deck == deck)
                {
                    starts = true;
                }
                thisCard.IsSelected = starts;
            });
            ScrollToBottom();
        }
        private void RepopulateCards()
        {
            if (_gameContainer.ModifyCards == null)
            {
                throw new BasicBlankException("Nobody is handling modify cards.  Rethink");
            }
            int x = _firstNumber;

            _gameContainer.ModifyCards.Invoke(HandList);
            EnumSuitList suitUsed = HandList.First(items => items.IsObjectWild == false).Suit;

            HandList.ForEach(thisCard =>
            {
                thisCard.Suit   = suitUsed;
                thisCard.UsedAs = x;
                x++;
            });
        }
        public PointInfo GetPointInfo(int player)
        {
            PointInfo output = new PointInfo();
            int       x      = 0;

            HandList.ForEach(thisCard =>
            {
                x++;
                if (thisCard.Player == player)
                {
                    output.NumberOfCards++;
                    if (x == 1 && _setType == EnumWhatSets.runs && thisCard.SecondNumber == EnumCardValueList.LowAce)
                    {
                        output.Points += 5;
                    }
                    else if (thisCard.Value == EnumCardValueList.HighAce || thisCard.SecondNumber == EnumCardValueList.LowAce)
                    {
                        output.Points += 15;
                    }
                    //else if (_setType == EnumWhatSets.kinds && thisCard.Value == EnumCardValueList.LowAce)
                    //    output.Points += 15; //if its in a kind, its 15 period.  this is the best way to handle that.
                    //else if (thisCard.Value == EnumCardValueList.HighAce)
                    //    output.Points += 15;
                    else if (thisCard.Value < EnumCardValueList.Eight)
                    {
                        output.Points += 5;
                    }

                    else
                    {
                        output.Points += 10;
                    }
                }
            });
            return(output);
        }
Ejemplo n.º 9
0
 public override void EndTurn()
 {
     _isNew = false;
     HandList.ForEach(thisTile => thisTile.WhatDraw = EnumDrawType.IsNone);
     base.EndTurn();
 }