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); }
public void ResetFlopBoardTextureCollection() { FlopBoardTextureCollection.ForEach(x => x.IsChecked = false); }