コード例 #1
0
 protected override void AfterPopulateObjects()
 {
     HandList.ForEach(thisCard =>
     {
         AddObjectToHand(thisCard); //even better.
     });
 }
コード例 #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);
        }
コード例 #3
0
 public void RefreshCards()
 {
     if (ThisScroll == null)
     {
         return;
     }
     HandList.ForEach(thisCard => thisCard.Visible = CanPositionCard(thisCard));
     ThisScroll.RecalculatePositioning();
 }
コード例 #4
0
 protected override void AfterPopulateObjects()
 {
     HandList.ForEach(thisCard =>
     {
         thisCard.Visible    = true;
         thisCard.Drew       = false;
         thisCard.IsSelected = false;
         thisCard.IsUnknown  = false;
     });
 }
コード例 #5
0
 public override void EndTurn()
 {
     HandList.ForEach(thisTile =>
     {
         if (thisTile.WhatDraw != EnumDrawType.FromSet)
         {
             thisTile.WhatDraw = EnumDrawType.IsNone;
         }
         thisTile.IsSelected = false;
     });
 }
コード例 #6
0
        public void SelectPastPoint(int deck)
        {
            bool starts = false;

            HandList.ForEach(thisCard =>
            {
                if (thisCard.Deck == deck)
                {
                    starts = true;
                }
                thisCard.IsSelected = starts;
            });
            ScrollToBottom();
        }
コード例 #7
0
        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++;
            });
        }
コード例 #8
0
        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);
        }
コード例 #9
0
 public override void EndTurn()
 {
     _isNew = false;
     HandList.ForEach(thisTile => thisTile.WhatDraw = EnumDrawType.IsNone);
     base.EndTurn();
 }