Exemple #1
0
 private async Task PrivateColumnAsync(PileInfoCP pile)
 {
     if (ColumnClickedAsync == null)
     {
         return;
     }
     await ColumnClickedAsync.Invoke(PileList.IndexOf(pile));
 }
        public async Task ShowRollingAsync(CustomBasicList <CustomBasicList <bool> > thisCol)
        {
            bool isLast = false;

            AsyncDelayer.SetDelayer(this, ref _delay !); //has to be here to learn lesson from other dice games.
            await thisCol.ForEachAsync(async firstList =>
            {
                if (thisCol.Last() == firstList)
                {
                    isLast = true;
                }
                int x;
                x = 0;
                firstList.ForEach(items =>
                {
                    SingleDiceInfo thisDice = FindNextPin(ref x);
                    thisDice.Populate(items);
                    thisDice.Index = DiceList.IndexOf(thisDice) + 1;
                    if (isLast == true) //animations has to show value
                    {
                        thisDice.DidHit = items;
                    }
                });
                await _delay.DelayMilli(50); //decided to have here less performance problem when rolling bowling dice.
            });

            if (isLast == false)
            {
                throw new BasicBlankException("Was never last for showing rolling.  Rethink");
            }
        }
        public int LetterRemaining()
        {
            var thisItem = (from items in _completeList
                            where vb.AscW(items) == 0
                            select items).Single();

            return(_completeList.IndexOf(thisItem));
        }
Exemple #4
0
 private async Task ThisSet_SetClickedAsync(RummyHandObservable <S, C, R> thisSet)
 {
     if (SetClickedAsync == null)
     {
         return;
     }
     if (thisSet.DidClickObject == true)
     {
         thisSet.DidClickObject = false;
         return;
     }
     await SetClickedAsync.Invoke(SetList.IndexOf(thisSet) + 1); //wanted to make it one based.
 }
        }                                              //decided its not worth taking a risk on this one.
        //public PlainCommand<SolitaireCard> ClockCommand { get; set; }
        public void ClearBoard()
        {
            int decks = 10000;

            ClockList !.ForEach(thisClock =>
            {
                thisClock.CardList.Clear();
                var thisCard = new SolitaireCard();
                decks++;
                thisCard.Deck = decks; //because of how the dictionary works.
                thisClock.CardList.Add(thisCard);
                if (ShowCenter || ClockList.IndexOf(thisClock) + 1 <= 4)
                {
                    thisClock.LeftGuide = 4;
                }
                else
                {
                    thisClock.LeftGuide = 3;
                }
            });
        }
        public void FillInRestOfColors() //this means fill rest of colors is no problem.
        {
            var thisList = ColorsLeft();

            thisList.ShuffleList();
            if (PlayerList.Any(x => x.DidChooseColor == false && x.InGame == true))
            {
                throw new BasicBlankException("There is at least one player who did not choose color who is in game.  That is wrong");
            }
            CustomBasicList <P> tempList = PlayerList.Where(Items => Items.DidChooseColor == false).ToCustomBasicList();

            tempList.ShuffleList();
            //i am guessing in this case, you have to literally have them match.
            if (thisList.Count != tempList.Count)
            {
                throw new BasicBlankException("Does not match.  Therefore, can't populate the rest of the colors");
            }
            tempList.ForEach(thisPlayer =>
            {
                thisPlayer.Color = thisList[tempList.IndexOf(thisPlayer)].EnumValue;
            });
        }