Пример #1
0
 public MatchDescription(Card card)
 {
     this.cardType        = card;
     this.countSource     = CountSource.Always;
     this.comparison      = Comparison.Equals;
     this.countThreshHold = 1;
 }
Пример #2
0
 public MatchDescription(CountSource countSource, Card cardType, Comparison comparison, int threshhold)
 {
     this.cardType        = cardType;
     this.countSource     = countSource;
     this.comparison      = comparison;
     this.countThreshHold = threshhold;
 }
Пример #3
0
 public MatchDescription(Card card)
 {
     this.cardType = card;
     this.countSource = CountSource.Always;
     this.comparison = Comparison.Equals;
     this.countThreshHold = 1;
 }
Пример #4
0
 public MatchDescription(CountSource countSource, Card cardType, Comparison comparison, int threshhold)
 {
     this.cardType = cardType;
     this.countSource = countSource;
     this.comparison = comparison;
     this.countThreshHold = threshhold;
 }
Пример #5
0
        public List <CountSource> GetCountSource(DateTime sDate, DateTime eDate)
        {
            List <CountSource> lc  = new List <CountSource>();
            string             sql = "SELECT source,count(id) as t from t_user where date(addOn) >='" + sDate.ToString("yyyy-MM-dd") + "' and date(addOn) <='" + eDate.ToString("yyyy-MM-dd") + "' GROUP BY source order by t desc";

            using (DataTable dt = helper.GetDataTable(sql))
            {
                if (dt != null && dt.Rows.Count > 0)
                {
                    Dictionary <string, source> Dic = new _Source().GetSourceDic();
                    foreach (DataRow r in dt.Rows)
                    {
                        CountSource b = new CountSource
                        {
                            source = r["source"].ToString(),
                            uNum   = Convert.ToInt16(r["t"].ToString()),
                            sName  = ""
                        };
                        if (Dic.ContainsKey(b.source))
                        {
                            b.sName = Dic[b.source].sName;
                        }
                        lc.Add(b);
                    }
                }
            }
            return(lc);
        }
Пример #6
0
 public static CardAcceptanceDescription For(Card card, CountSource countSouce, Card testCard, Comparison comparison, int threshhold)
 {
     return(new CardAcceptanceDescription(card, new MatchDescription[]
     {
         new MatchDescription(CountSource.Always, card, Comparison.GreaterThan, 0),
         new MatchDescription(countSouce, testCard, Comparison.LessThan, threshhold),
     }));
 }
 public static CardAcceptanceDescription For(Card card, int count, Card testCard, CountSource countSouce, Comparison comparison, int threshhold)
 {
     return new CardAcceptanceDescription(card, new MatchDescription[]
     {
         new MatchDescription(CountSource.CountAllOwned, card, Comparison.LessThan, count),
         new MatchDescription(countSouce, testCard, comparison, threshhold),
     });
 }
 public static CardAcceptanceDescription For(Card card, CountSource countSouce, Card testCard, Comparison comparison, int threshhold)
 {
     return new CardAcceptanceDescription(card, new MatchDescription[]
     {
         new MatchDescription(CountSource.Always, card, Comparison.GreaterThan, 0),
         new MatchDescription(countSouce, testCard, comparison, threshhold),
     });
 }
Пример #9
0
 public static CardAcceptanceDescription For(Card card, int count, Card testCard, CountSource countSouce, Comparison comparison, int threshhold)
 {
     return(new CardAcceptanceDescription(card, new MatchDescription[]
     {
         new MatchDescription(CountSource.CountAllOwned, card, Comparison.LessThan, count),
         new MatchDescription(countSouce, testCard, comparison, threshhold),
     }));
 }
Пример #10
0
 public CardAcceptanceDescription(Card card, CountSource countSource, Card matchOn, Comparison comparison, int threshhold)
     : this(card, new MatchDescription(countSource, matchOn, comparison, threshhold))
 {
 }
Пример #11
0
        public static CardAcceptance For(Card card, CountSource countSource, Comparison comparison, int threshhold, GameStatePredicate match)
        {
            MatchDescription descr = new MatchDescription(card, countSource, comparison, threshhold);

            return CardAcceptance.For(card, gameState => descr.GameStatePredicate(gameState) && match(gameState));
        }
Пример #12
0
        public static CardAcceptance For(Card card, CountSource countSource, Comparison comparison, int threshhold)
        {
            MatchDescription descr = new MatchDescription(card, countSource, comparison, threshhold);

            return descr.ToCardAcceptance();
        }
Пример #13
0
        public static CardAcceptance For(Card card, CountSource countSource, Comparison comparison, int threshhold, GameStatePredicate match)
        {
            MatchDescription descr = new MatchDescription(card, countSource, comparison, threshhold);

            return(CardAcceptance.For(card, gameState => descr.GameStatePredicate(gameState) && match(gameState)));
        }
Пример #14
0
        public static CardAcceptance For(Card card, CountSource countSource, Comparison comparison, int threshhold)
        {
            MatchDescription descr = new MatchDescription(card, countSource, comparison, threshhold);

            return(descr.ToCardAcceptance());
        }
 public CardAcceptanceDescription(Card card, CountSource countSource, Card matchOn, Comparison comparison, int threshhold)
     : this(card, new MatchDescription(countSource, matchOn, comparison, threshhold))
 {
 }