예제 #1
0
    /// <summary>
    /// 搓牌按钮点击
    /// </summary>
    public void OnCuoCardClick()
    {
        XXGoldFlowerGameModel.Inst.mCuoCarding = true;
        SendGoldFlowerOpt req = new SendGoldFlowerOpt();

        req.ins = (int)(eGFOptIns.LookCard);
        Global.Inst.GetController <XXGoldFlowerGameController>().SendOpt(req);
    }
예제 #2
0
    /// <summary>
    /// 下注的点击
    /// </summary>
    /// <param name="go"></param>
    public void OnAddBetBtnItemClick(GameObject go)
    {
        SendGoldFlowerOpt req = new SendGoldFlowerOpt();
        int add = int.Parse(go.name);

        req.ins = (int)eGFOptIns.Add;
        req.bet = add;
        Global.Inst.GetController <XXGoldFlowerGameController>().SendOpt(req);
    }
예제 #3
0
 /// <summary>
 /// 发送指令
 /// </summary>
 /// <param name="opt"></param>
 public void SendOpt(SendGoldFlowerOpt opt, CallBack call = null)
 {
     NetProcess.SendRequest <SendGoldFlowerOpt>(opt, GoldFlowerProtoIdMap.CMD_SendOpt, (msg) =>
     {
         CommonRecieveProto ack = msg.Read <CommonRecieveProto>();
         if (ack.code == 1)
         {
             if (call != null)
             {
                 call();
             }
         }
         else
         {
             GameUtils.ShowErrorTips(ack.code);
         }
     });
 }
예제 #4
0
 /// <summary>
 /// 头像点击事件
 /// </summary>
 public void OnHeadClick()
 {
     if (SeatId > 0)
     {
         if (XXGoldFlowerGameModel.Inst.mComparingCard && SeatId != XXGoldFlowerGameModel.Inst.mMySeatId)
         {//正在比牌
             SendGoldFlowerOpt req = new SendGoldFlowerOpt();
             req.ins         = (int)eGFOptIns.Compare;
             req.otherSeatId = SeatId;
             Global.Inst.GetController <XXGoldFlowerGameController>().SendOpt(req, () =>
             {
                 XXGoldFlowerGameModel.Inst.mComparingCard = false;
             });
         }
         else
         {//没有在比牌
             Global.Inst.GetController <XXGoldFlowerGameController>().SendGetPlayerInfo(XXGoldFlowerGameModel.Inst.mPlayerInfoDic[mSeatId].userId, mSeatId);
         }
     }
 }
예제 #5
0
    /// <summary>
    /// 操作点击
    /// </summary>
    public void OnOptBtnClick(GameObject indexGo)
    {
        SendGoldFlowerOpt req = new SendGoldFlowerOpt();
        int       index       = int.Parse(indexGo.name);
        eGFOptIns optIns      = (eGFOptIns)index;

        if (optIns == eGFOptIns.Add)//加注按钮
        {
            if (XXGoldFlowerGameModel.Inst.mLookCard)
            {
                InitAddList(XXGoldFlowerGameModel.Inst.mStartInfo.lookRate);
            }
            else
            {
                InitAddList(XXGoldFlowerGameModel.Inst.mStartInfo.menRate);
            }
            ShowAddBtnList(XXGoldFlowerGameModel.Inst.mOpt.jiazhuList);
        }
        else if (optIns == eGFOptIns.Compare)//比牌
        {
            Global.Inst.GetController <CommonTipsController>().ShowTips("是否确定要比牌?", "比牌|取消", () =>
            {
                XXGoldFlowerGameModel.Inst.mComparingCard = true;
                if (XXGoldFlowerGameModel.Inst.mHasCardSeatList.Count == 2)
                {
                    int temp = 1;
                    for (int i = 0; i < XXGoldFlowerGameModel.Inst.mHasCardSeatList.Count; i++)
                    {
                        if (XXGoldFlowerGameModel.Inst.mHasCardSeatList[i] != XXGoldFlowerGameModel.Inst.mMySeatId)
                        {
                            temp = XXGoldFlowerGameModel.Inst.mHasCardSeatList[i];
                        }
                    }
                    SendGoldFlowerOpt teme = new SendGoldFlowerOpt();
                    teme.ins         = (int)eGFOptIns.Compare;
                    teme.otherSeatId = temp;
                    Global.Inst.GetController <XXGoldFlowerGameController>().SendOpt(teme, () =>
                    {
                        XXGoldFlowerGameModel.Inst.mComparingCard = false;
                    });
                }
                else
                {
                    Global.Inst.GetController <XXGoldFlowerGameController>().mView.SetShowCompareSelectSp(true);
                }
            });
        }
        else if (optIns == eGFOptIns.DisCard)//弃牌提示
        {
            Global.Inst.GetController <CommonTipsController>().ShowTips("是否确定要弃牌?", "确定|取消", () =>
            {
                req.ins = index;
                Global.Inst.GetController <XXGoldFlowerGameController>().SendOpt(req);
            });
        }
        else
        {
            req.ins = index;
            Global.Inst.GetController <XXGoldFlowerGameController>().SendOpt(req);
        }
    }