Exemplo n.º 1
0
        private Expression <Func <Playerstatistic, bool> > GetPredicateForStreet(Street street)
        {
            Expression <Func <Playerstatistic, bool> > predicate = null;
            var button = GetButonsCollectionForStreet(street).FirstOrDefault(x => x.IsChecked);

            if (button != null)
            {
                var collection = GetItemsCollectionForStreet(street).Where(x => x.BeginningActionType == button.HandActionType);
                if (collection != null && collection.Any(x => x.IsChecked))
                {
                    foreach (var item in collection.Where(x => x.IsChecked))
                    {
                        if (predicate == null)
                        {
                            predicate = PredicateBuilder.Create <Playerstatistic>(x => FilterHelpers.CheckActionLine(x.Line, item.ToString(), street));
                        }
                        else
                        {
                            predicate = predicate.Or(x => FilterHelpers.CheckActionLine(x.Line, item.ToString(), street));
                        }
                    }
                }
            }

            return(predicate);
        }
Exemplo n.º 2
0
        public Expression <Func <Playerstatistic, bool> > GetFilterPredicate()
        {
            if (!HoleCardsCollection.Any(x => !x.IsChecked))
            {
                return(null);
            }

            var checkedHoleCards   = HoleCardsCollection.Where(x => x.IsChecked);
            var holeCardsPredicate = PredicateBuilder.Create <Playerstatistic>(x => FilterHelpers.CheckHoleCards(x.Cards, checkedHoleCards));

            return(holeCardsPredicate);
        }
        public Expression <Func <Playerstatistic, bool> > GetFilterPredicate()
        {
            Expression <Func <Playerstatistic, bool> > resultPredicate = null;
            var analyzers = OmahaHoleCardsAnalyzer.GetDefaultOmahaHoleCardsAnalyzers();

            if (HandGridCollection.Any(x => x.IsChecked))
            {
                var collection = HandGridCollection.Where(x => x.IsChecked);
                resultPredicate = PredicateBuilder.Create <Playerstatistic>(p => FilterHelpers.CheckOmahaHoleCards(p.Cards, collection));
            }

            return(resultPredicate);
        }