Example #1
0
        private Expression <Func <Playerstatistic, bool> > GetBoardTexturePredicate()
        {
            Expression <Func <Playerstatistic, bool> > resultPredicate = null;
            var analyzers = BoardTextureAnalyzer.GetDefaultAnalyzers();

            if (FlopBoardTextureCollection.Any(x => x.IsChecked))
            {
                if (resultPredicate == null)
                {
                    resultPredicate = PredicateBuilder.False <Playerstatistic>();
                }

                var collection = FlopBoardTextureCollection.Where(x => x.IsChecked);
                resultPredicate = resultPredicate.Or(p => collection.All(item => analyzers.First(a => a.GetRank() == item.BoardTexture).Analyze(BoardCards.FromCards(p.Board), item)));
            }

            if (TurnBoardTextureCollection.Any(x => x.IsChecked))
            {
                if (resultPredicate == null)
                {
                    resultPredicate = PredicateBuilder.False <Playerstatistic>();
                }

                var collection = TurnBoardTextureCollection.Where(x => x.IsChecked);
                resultPredicate = resultPredicate.Or(p => collection.All(item => analyzers.First(a => a.GetRank() == item.BoardTexture).Analyze(BoardCards.FromCards(p.Board), item)));
            }

            if (RiverBoardTextureCollection.Any(x => x.IsChecked))
            {
                if (resultPredicate == null)
                {
                    resultPredicate = PredicateBuilder.False <Playerstatistic>();
                }

                var collection = RiverBoardTextureCollection.Where(x => x.IsChecked);
                resultPredicate = resultPredicate.Or(p => collection.All(item => analyzers.First(a => a.GetRank() == item.BoardTexture).Analyze(BoardCards.FromCards(p.Board), item)));
            }

            return(resultPredicate);
        }
Example #2
0
 public void ResetTurnBoardTextureCollection()
 {
     TurnBoardTextureCollection.ForEach(x => x.IsChecked = false);
 }