Пример #1
0
        private bool AddPage(int addValue)
        {
            MailWindow.TabData currentTabData = this.currentTabData;
            if (currentTabData == null)
            {
                return(false);
            }
            int          page     = currentTabData.currentPage + addValue;
            MailPageData pageData = currentTabData.GetPageData(page);

            if (pageData == null)
            {
                return(false);
            }
            currentTabData.currentPage = page;
            MonoSingleton <GameManager> .Instance.Player.CurrentMails = pageData.mails;
            return(true);
        }
Пример #2
0
        private void Refresh()
        {
            Func <MailWindow.TabData, MailWindow.TabType, MailWindow.TabData> func = (Func <MailWindow.TabData, MailWindow.TabType, MailWindow.TabData>)((tabData, tabType) =>
            {
                if (tabData == null)
                {
                    tabData         = new MailWindow.TabData();
                    tabData.tabType = tabType;
                }
                return(tabData);
            });

            this.notPeriodTab = func(this.notPeriodTab, MailWindow.TabType.NotPeriod);
            this.periodTab    = func(this.periodTab, MailWindow.TabType.Period);
            this.readTab      = func(this.readTab, MailWindow.TabType.Read);
            this.notPeriodTab.Clear();
            this.periodTab.Clear();
            this.readTab.Clear();
        }
Пример #3
0
        private void RequestPrevMails()
        {
            MailWindow.TabData currentTabData = this.currentTabData;
            if (currentTabData == null || !currentTabData.HasPrev())
            {
                return;
            }
            switch (currentTabData.tabType)
            {
            case MailWindow.TabType.NotPeriod:
                this.SetMailRequestData(currentTabData.currentPage - 1, false, false);
                break;

            case MailWindow.TabType.Period:
                this.SetMailRequestData(currentTabData.currentPage - 1, true, false);
                break;

            case MailWindow.TabType.Read:
                this.SetMailRequestData(currentTabData.currentPage - 1, false, true);
                break;
            }
        }