コード例 #1
0
ファイル: MentorshipPersonWnd.cs プロジェクト: zwong91/Titan
 private void OnDismissMentorhsip()
 {
     if (m_bSelfPrentice && m_MentorshipID > 0)
     {
         GameLogic.cmd_mentorship_request_dismiss cmdData = new GameLogic.cmd_mentorship_request_dismiss();
         cmdData.nMentorshipID = m_MentorshipID;
         ViewEventHelper.Instance.SendCommand <cmd_mentorship_request_dismiss>(GameLogicDef.GVIEWCMD_MENTORSHIP_REQUESTDISMISS, ref cmdData);
     }
 }
コード例 #2
0
 public void SendDismissMentorship(int nMentorshipID)
 {
     GameLogic.cmd_mentorship_request_dismiss cmdData = new GameLogic.cmd_mentorship_request_dismiss();
     cmdData.nMentorshipID = nMentorshipID;
     ViewEventHelper.Instance.SendCommand <GameLogic.cmd_mentorship_request_dismiss>(GameLogicDef.GVIEWCMD_MENTORSHIP_REQUESTDISMISS, ref cmdData);
 }
コード例 #3
0
        public void OnRecvMentorshipDismiss(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen);

            GameLogic.cmd_mentorship_request_dismiss cmdRecvData = helper.get <GameLogic.cmd_mentorship_request_dismiss>();

            foreach (var fItem in m_FPrenticeList)
            {
                if (cmdRecvData.nMentorshipID == fItem.nMentorshipID)
                {
                    m_FPrenticeList.Remove(fItem);
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEFPRENTICELIST, null);
                    return;
                }
            }

            foreach (var iItem in m_IPrenticeList)
            {
                if (cmdRecvData.nMentorshipID == iItem.nMentorshipID)
                {
                    m_IPrenticeList.Remove(iItem);
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEIPRENTICELIST, null);
                    return;
                }
            }

            int nMasterPDBID = 0;

            foreach (var mItem in m_MasterList)
            {
                if (cmdRecvData.nMentorshipID == mItem.nMentorshipID)
                {
                    nMasterPDBID = mItem.nPDBID;
                    m_MasterList.Remove(mItem);
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEMASTERLIST, null);
                    break;
                }
            }

            if (nMasterPDBID == 0)
            {
                return;
            }

            bool bClearFlag = false;

            foreach (var mFItem in m_MasterFPrenticeList)
            {
                if (nMasterPDBID == mFItem.nMasterPDBID)
                {
                    bClearFlag = true;
                    break;
                }
            }

            if (bClearFlag == true)
            {
                m_MasterFPrenticeList.Clear();
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEMASTERFPRENTICELIST, null);
            }

            bClearFlag = false;
            foreach (var mIItem in m_MasterIPrenticeList)
            {
                if (nMasterPDBID == mIItem.nMasterPDBID)
                {
                    bClearFlag = true;
                    break;
                }
            }

            if (bClearFlag == true)
            {
                m_MasterIPrenticeList.Clear();
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEMASTERIPRENTICELIST, null);
            }
        }