コード例 #1
0
        /// <summary>
        /// 启动按钮响应
        /// </summary>
        public void StartBT_OnClick()
        {
            //第一次请求发牌
            if (!UIManger.Instance.m_bIsUpdateCard)
            {
                if (CPokerPointsManger._instance.m_iBasePointBK == 0 && CPokerPointsManger._instance.m_iBasePoints == 0)
                {
                    return;
                }
                if (CPokerPointsManger._instance.m_iBasePoints == UIManger.Instance.m_iGameStartPoint)
                {
                    CPokerPointsManger._instance.m_iBasePoints = CPokerPointsManger._instance.m_iBasePointBK;
                }

                CPlayerInfo._instance.m_iBet = CPokerPointsManger._instance.m_iBasePoints;
                CPokerPointsManger._instance.m_iBasePointBK = CPokerPointsManger._instance.m_iBasePoints;
                m_bIsFirstInput = true;
                //请求发牌
                NPacket packet = NPacketPool.GetEnablePacket();
                packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_START_DEAL_JX);

                //压分
                packet.AddLong(CPokerPointsManger._instance.m_iBasePoints);
                //此数据无效
                packet.AddInt(0);

                GameEngine.Instance.Send(packet);
                SetButtonBt(m_gStartBT, true);
                SetButtonBt(m_gInputScoreBT, true);
            }
            //第二次请求发牌
            else
            {
                NPacket packet = NPacketPool.GetEnablePacket();
                packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_UPDATE_CARD_JX);
                packet.AddBytes(UIManger.Instance.m_cUpdateCard.cCard.cbCard, UIManger.Instance.m_cUpdateCard.cCard.cbCard.Length);
                for (int i = 0; i < UIManger.Instance.m_cUpdateCard.cCard.bBarter.Length; i++)
                {
                    //牌的值
                    packet.AddBool(UIManger.Instance.m_cUpdateCard.cCard.bBarter[i]);
                }
                GameEngine.Instance.Send(packet);
                SetButtonBt(m_gStartBT, true);
            }
            SetButtonBt(m_gRecordBT, true);
            CBottomBTOnclick._instance.SetButtonBt(CBottomBTOnclick._instance.m_gMoreThanBT, true);
            CBottomBTOnclick._instance.m_bIsCompareFree = false;
            UIManger.Instance.m_bIsPlayingGame          = true;
        }