Exemplo n.º 1
0
        private Expression <Func <Playerstatistic, bool> > GetBoardCardItemsPredicate()
        {
            Expression <Func <Playerstatistic, bool> > resultPredicate = null;
            var analyzer = new ExactCardsTextureAnalyzer();

            if (FlopCardItemsCollection.Any(x => x.Suit != RangeCardSuit.None))
            {
                var collection = FlopCardItemsCollection.Where(x => x.Suit != RangeCardSuit.None);
                if (resultPredicate == null)
                {
                    resultPredicate = PredicateBuilder.Create <Playerstatistic>(x => analyzer.Analyze(x.Board, collection));
                }
                else
                {
                    resultPredicate = resultPredicate.Or(x => analyzer.Analyze(x.Board, collection));
                }
            }

            if (TurnCardItemsCollection.Any(x => x.Suit != RangeCardSuit.None))
            {
                var collection = TurnCardItemsCollection.Where(x => x.Suit != RangeCardSuit.None);
                if (resultPredicate == null)
                {
                    resultPredicate = PredicateBuilder.Create <Playerstatistic>(x => analyzer.Analyze(x.Board, collection));
                }
                else
                {
                    resultPredicate = resultPredicate.Or(x => analyzer.Analyze(x.Board, collection));
                }
            }

            if (RiverCardItemsCollection.Any(x => x.Suit != RangeCardSuit.None))
            {
                var collection = RiverCardItemsCollection.Where(x => x.Suit != RangeCardSuit.None);
                if (resultPredicate == null)
                {
                    resultPredicate = PredicateBuilder.Create <Playerstatistic>(x => analyzer.Analyze(x.Board, collection));
                }
                else
                {
                    resultPredicate = resultPredicate.Or(x => analyzer.Analyze(x.Board, collection));
                }
            }

            return(resultPredicate);
        }
Exemplo n.º 2
0
 public void ResetFlopCardItemsCollection()
 {
     FlopCardItemsCollection.ForEach(x => x.Reset());
 }