private void ModifyData(int chosen, EnumMilkType tempMilk)
        {
            MilkCategory = tempMilk;
            Deck         = chosen;
            int tempDeck;

            if (Deck <= 61)
            {
                tempDeck = chosen;
            }
            else
            {
                tempDeck = chosen - 61;
            }
            int c;
            int z = 0;

            for (int x = 1; x <= 12; x++)
            {
                c = GetPointFreq(x);
                for (int y = 1; y <= c; y++)
                {
                    z++;
                    if (z == tempDeck)
                    {
                        CardCategory = EnumCardCategory.Points;
                        Points       = x;
                        return;
                    }
                }
            }
            for (int x = 1; x <= 7; x++)
            {
                z++;
                if (z == tempDeck)
                {
                    CardCategory = EnumCardCategory.Go;
                    return;
                }
            }
            for (int x = 1; x <= 3; x++)
            {
                z++;
                if (z == tempDeck)
                {
                    CardCategory = EnumCardCategory.Stop;
                    return;
                }
            }
            for (int x = 1; x <= 3; x++)
            {
                z++;
                if (z == tempDeck)
                {
                    CardCategory = EnumCardCategory.Joker;
                    return;
                }
            }
            throw new BasicBlankException("cannot find deck.  rethink");
        }
Exemplo n.º 2
0
        private static void CardCategoryPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            var thisItem = (CardGraphicsXF)bindable;

            thisItem.MainObject !.CardCategory = (EnumCardCategory)newValue;
        }
        private static void CardCategoryPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var thisItem = (CardGraphicsWPF)sender;

            thisItem.MainObject !.CardCategory = (EnumCardCategory)e.NewValue;
        }
        public static DeckRegularDict <C> GetMailOrDealList <C>(this IDeckDict <CardInformation> tempList, EnumCardCategory whichType) where C : CardInformation, new()
        {
            var firstList = tempList.Where(items => items.CardCategory == whichType);
            DeckRegularDict <C> output = new DeckRegularDict <C>();

            foreach (var thisItem in firstList)
            {
                output.Add((C)thisItem);
            }
            return(output);
        }