Exemple #1
0
        public void Add(int type, int value, bool isMerge = true)
        {
            if (!this.tasks.ContainsKey(type.ToString()))
            {
                return;
            }
            LocalData localData = this.tasks[type.ToString()];

            if (isMerge)
            {
                localData.value += value;
            }
            else
            {
                localData.value = value;
            }
            this.tasks[type.ToString()] = localData;
            this.SetLocalData(localData.type, localData.value, localData.key, localData.status);
            GlobalEventHandle.EmitRefreshTaskHandle(type);
            if (localData.status != -1)
            {
                return;
            }
            TTask tTask = Configs.Configs.TTasks[localData.key.ToString()];

            if (localData.value >= tTask.Value)
            {
                localData.status = -2;
            }
            this.tasks[type.ToString()] = localData;
            this.SetLocalData(localData.type, localData.value, localData.key, localData.status);
            DotManager.GetInstance().CheckTask();
            GlobalEventHandle.EmitRefreshTaskHandle(type);
        }
        public void Update()
        {
            if (this.m_isWatch)
            {
                return;
            }
            this.RefreshRewardTime();
            int num = (int)Math.Ceiling((double)(600f - this.m_stimulateTimer));

            if (num <= 0)
            {
                this.m_isWatch        = true;
                this.m_stimulateTimer = 0f;
                DotManager.GetInstance().CheckAds();
            }
            GlobalEventHandle.EmitAdsHandle(string.Format("{0:D2}:{1:D2}", num / 60, num % 60), this.m_isWatch);
        }