Ejemplo n.º 1
0
    public void QueryLotteryEntry(RichDataEntry entry)
    {
        JsonData result;

        if (!m_resultEntryMap.TryGetValue(entry.m_Issue, out result))
        {
            if (m_lastedIssue > entry.m_Issue)
            {
                entry.m_isExpired = true;
            }
            return;
        }


        string[] strArr = result["opencode"].ToString().Replace('+', ',').Split(',');
        entry.m_LotteryNumbers = new int[strArr.Length];
        for (int i = 0; i < strArr.Length; i++)
        {
            entry.m_LotteryNumbers[i] = int.Parse(strArr[i]);
        }

        //entry.m_Date = JsonMapper.ToObject<DateTime>(result["opentime"].ToJson());
        entry.m_Date = DateTime.Parse(result["opentime"].ToString());


        ILotteryRule rule = LotteryRuleFactory.GetLotteryRule(m_curType);

        rule.Compare(entry);

        entry.m_hasResult = true;
    }
Ejemplo n.º 2
0
    void Awake()
    {
        msRichEngine = this;

        m_setting.Load();

        m_dataCenter = new RichDataManager();
        m_dataCenter.LoadData();

        m_data = m_dataCenter.GetQueryArchieve();

        m_query = LotteryQueryFactory.GetLotteryQuery(m_setting.UseQueryAPI);

        m_timeCount = 0;    //保证第一次的query

        //修复错误
        foreach (var record in m_data.m_RecordsList)
        {
            ILotteryRule rule = LotteryRuleFactory.GetLotteryRule(record.m_LotteryType);

            foreach (var entry in record.m_RichList)
            {
                rule.Compare(entry);
            }
        }
    }
Ejemplo n.º 3
0
 public static void Regist(string lotteryType, ILotteryRule rule)
 {
     ms_LotteryRuleMap.Add(lotteryType, rule);
 }