public MatchDescription(Card card) { this.cardType = card; this.countSource = CountSource.Always; this.comparison = Comparison.Equals; this.countThreshHold = 1; }
public MatchDescription(CountSource countSource, Card cardType, Comparison comparison, int threshhold) { this.cardType = cardType; this.countSource = countSource; this.comparison = comparison; this.countThreshHold = threshhold; }
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); }
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), }); }
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 CardAcceptanceDescription(Card card, CountSource countSource, Card matchOn, Comparison comparison, int threshhold) : this(card, new MatchDescription(countSource, matchOn, comparison, threshhold)) { }
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)); }
public static CardAcceptance For(Card card, CountSource countSource, Comparison comparison, int threshhold) { MatchDescription descr = new MatchDescription(card, countSource, comparison, threshhold); return descr.ToCardAcceptance(); }
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))); }
public static CardAcceptance For(Card card, CountSource countSource, Comparison comparison, int threshhold) { MatchDescription descr = new MatchDescription(card, countSource, comparison, threshhold); return(descr.ToCardAcceptance()); }