コード例 #1
0
        public override void OnActivate(int pinID)
        {
            switch (pinID)
            {
            case 0:
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                FlowNode_ReadMail2.\u003COnActivate\u003Ec__AnonStorey212 activateCAnonStorey212 = new FlowNode_ReadMail2.\u003COnActivate\u003Ec__AnonStorey212();
                MailWindow.MailReadRequestData dataOfClass = DataSource.FindDataOfClass <MailWindow.MailReadRequestData>(((Component)this).get_gameObject(), (MailWindow.MailReadRequestData)null);
                if (Network.Mode == Network.EConnectMode.Offline)
                {
                    this.ActivateOutputLinks(21);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                List <MailData> currentMails = MonoSingleton <GameManager> .Instance.Player.CurrentMails;
                List <MailData> mailDataList = new List <MailData>();
                // ISSUE: reference to a compiler-generated field
                activateCAnonStorey212.ids = new List <long>((IEnumerable <long>)dataOfClass.mailIDs);
                // ISSUE: reference to a compiler-generated method
                List <MailData> all = currentMails.FindAll(new Predicate <MailData>(activateCAnonStorey212.\u003C\u003Em__202));
                if (all.Count < 1)
                {
                    this.ActivateOutputLinks(21);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                List <GiftData> giftDataList = new List <GiftData>();
                using (FlowNode_ReadMail2.HaveCheckScope haveCheckScope = new FlowNode_ReadMail2.HaveCheckScope())
                {
                    using (List <MailData> .Enumerator enumerator = all.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            MailData current = enumerator.Current;
                            if (haveCheckScope.CheckReceivable(current))
                            {
                                mailDataList.Add(current);
                                if (current.gifts != null)
                                {
                                    for (int index = 0; index < current.gifts.Length; ++index)
                                    {
                                        if (current.gifts[index] != null)
                                        {
                                            giftDataList.Add(current.gifts[index]);
                                        }
                                    }
                                }
                                haveCheckScope.AddCurrentNum(current);
                            }
                        }
                    }
                }
                if (giftDataList.Count >= 1)
                {
                    GlobalVars.UnitGetReward = new UnitGetParam(giftDataList.ToArray());
                }
                if (mailDataList.Count < 1)
                {
                    this.ActivateOutputLinks(23);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                this.mReceiveStatus = mailDataList.Count >= all.Count ? FlowNode_ReadMail2.ReceiveStatus.Recieve : FlowNode_ReadMail2.ReceiveStatus.NotReceiveSome;
                long[] mailids = new long[mailDataList.Count];
                for (int index = 0; index < mailDataList.Count; ++index)
                {
                    mailids[index] = mailDataList[index].mid;
                }
                this.ExecRequest((WebAPI) new ReqMailRead(mailids, dataOfClass.isPeriod, dataOfClass.page, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                break;

            case 5:
            case 6:
            case 7:
                string str = GlobalVars.UnlockUnitID;
                switch (pinID - 5)
                {
                case 0:
                    str = GlobalVars.UnlockUnitID;
                    break;

                case 1:
                    str = GlobalVars.ItemSelectListItemData.iiname;
                    this.AnalyticsTrackItemReceived(str, 1);
                    break;

                case 2:
                    str = GlobalVars.ArtifactListItem.iname;
                    this.AnalyticsTrackItemReceived(str, 1);
                    break;
                }
                if (!string.IsNullOrEmpty(str) && pinID == 5)
                {
                    GlobalVars.UnitGetReward = new UnitGetParam(MonoSingleton <GameManager> .Instance.GetItemParam(str));
                }
                this.mReceiveStatus = FlowNode_ReadMail2.ReceiveStatus.Recieve;
                if (Network.Mode == Network.EConnectMode.Offline)
                {
                    ((Behaviour)this).set_enabled(false);
                    this.Success();
                    break;
                }
                this.ExecRequest((WebAPI) new ReqMailRead((long)GlobalVars.SelectedMailUniqueID, (int)GlobalVars.SelectedMailPeriod == 1, (int)GlobalVars.SelectedMailPage, str, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                break;
            }
        }
コード例 #2
0
        public override void OnActivate(int pinID)
        {
            switch (pinID)
            {
            case 0:
                MailWindow.MailReadRequestData dataOfClass = DataSource.FindDataOfClass <MailWindow.MailReadRequestData>(((Component)this).get_gameObject(), (MailWindow.MailReadRequestData)null);
                if (Network.Mode == Network.EConnectMode.Offline)
                {
                    this.ActivateOutputLinks(21);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                List <MailData> currentMails = MonoSingleton <GameManager> .Instance.Player.CurrentMails;
                List <MailData> mailDataList = new List <MailData>();
                List <long>     ids          = new List <long>((IEnumerable <long>)dataOfClass.mailIDs);
                List <MailData> all          = currentMails.FindAll((Predicate <MailData>)(md =>
                {
                    if (!ids.Contains(md.mid))
                    {
                        return(false);
                    }
                    ids.Remove(md.mid);
                    return(true);
                }));
                if (all.Count < 1)
                {
                    this.ActivateOutputLinks(21);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                List <GiftData> giftDataList = new List <GiftData>();
                using (FlowNode_ReadMail2.HaveCheckScope haveCheckScope = new FlowNode_ReadMail2.HaveCheckScope())
                {
                    using (List <MailData> .Enumerator enumerator = all.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            MailData current = enumerator.Current;
                            if (haveCheckScope.CheckReceivable(current))
                            {
                                mailDataList.Add(current);
                                if (current.gifts != null)
                                {
                                    for (int index = 0; index < current.gifts.Length; ++index)
                                    {
                                        if (current.gifts[index] != null)
                                        {
                                            giftDataList.Add(current.gifts[index]);
                                        }
                                    }
                                }
                                haveCheckScope.AddCurrentNum(current);
                            }
                        }
                    }
                }
                if (giftDataList.Count >= 1)
                {
                    GlobalVars.UnitGetReward = new UnitGetParam(giftDataList.ToArray());
                }
                if (mailDataList.Count < 1)
                {
                    this.ActivateOutputLinks(23);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                this.mReceiveStatus = mailDataList.Count >= all.Count ? FlowNode_ReadMail2.ReceiveStatus.Recieve : FlowNode_ReadMail2.ReceiveStatus.NotReceiveSome;
                long[] mailids = new long[mailDataList.Count];
                for (int index = 0; index < mailDataList.Count; ++index)
                {
                    mailids[index] = mailDataList[index].mid;
                }
                this.ExecRequest((WebAPI) new ReqMailRead(mailids, dataOfClass.isPeriod, dataOfClass.page, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                break;

            case 5:
            case 6:
            case 7:
            case 8:
                string str = GlobalVars.UnlockUnitID;
                if (pinID == 5)
                {
                    str = GlobalVars.UnlockUnitID;
                    if (!string.IsNullOrEmpty(str))
                    {
                        GlobalVars.UnitGetReward = new UnitGetParam(MonoSingleton <GameManager> .Instance.GetItemParam(str));
                    }
                }
                else if (pinID == 6)
                {
                    str = GlobalVars.ItemSelectListItemData.iiname;
                }
                else if (pinID == 7)
                {
                    str = GlobalVars.ArtifactListItem.iname;
                }
                else if (pinID == 8)
                {
                    str = GetConceptCardListWindow.GetSelectedConceptCard();
                    GetConceptCardListWindow.ClearSelectedConceptCard();
                }
                this.mReceiveStatus = FlowNode_ReadMail2.ReceiveStatus.Recieve;
                if (Network.Mode == Network.EConnectMode.Offline)
                {
                    ((Behaviour)this).set_enabled(false);
                    this.Success();
                    break;
                }
                this.ExecRequest((WebAPI) new ReqMailRead((long)GlobalVars.SelectedMailUniqueID, (int)GlobalVars.SelectedMailPeriod == 1, (int)GlobalVars.SelectedMailPage, str, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                break;
            }
        }