コード例 #1
0
        public void OffFengWei(FengWei fengWei)
        {
            qiDongQiMatTweener.Pause();

            fengWeiQiDongQiOn[(int)fengWei].gameObject.SetActive(false);
            fengWeiQiDongQiOff[(int)fengWei].gameObject.SetActive(true);
        }
コード例 #2
0
        public void OnFengWei(FengWei fengWei)
        {
            OffFengWei(curtOnFengWei);

            fengWeiQiDongQiOn[(int)fengWei].gameObject.SetActive(true);
            fengWeiQiDongQiOff[(int)fengWei].gameObject.SetActive(false);
            qiDongQiMatTweener.Play();
            curtOnFengWei = fengWei;
        }
コード例 #3
0
        /// <summary>
        /// 洗牌
        /// </summary>
        public void XiPai(int dealerSeatIdx, FengWei fengWei, LinkedListNode <MahjongMachineCmd> opCmdNode = null)
        {
            if (mjMachineStateData.state != MahjongMachineState.END)
            {
                RemoveCommonActionOpCmd(opCmdNode);
                return;
            }

            NewRound();

            mjMachineStateData.SetXiPaiData(dealerSeatIdx, fengWei, opCmdNode);
            mjMachineStateData.SetState(MahjongMachineState.XIPAI_START, Time.time, -1);
        }
コード例 #4
0
    /// <summary>
    /// 设置圈风位
    /// </summary>
    /// <param name="dealerSeatIdx"></param>
    public void SetDealer(int dealerSeatIdx, FengWei fengWei)
    {
        int fw = (int)fengWei;

        this.dealerSeatIdx = dealerSeatIdx;

        for (int i = 0; i < 4; i++)
        {
            orderSeatIdx[i] = dealerSeatIdx;

            fw %= 4;
            seatFengWei[dealerSeatIdx] = (FengWei)fw;
            fw++;

            dealerSeatIdx--;
            if (dealerSeatIdx == -1)
            {
                dealerSeatIdx = 3;
            }
        }
    }
コード例 #5
0
 /// <summary>
 /// 设置指定座位的风位
 /// </summary>
 /// <param name="seatIdx"></param>
 public void SetSeatFengWei(int seatIdx, FengWei fengWei)
 {
     qiDongQi.transform.localEulerAngles = new Vector3(0, FengWeiRot[seatIdx, (int)fengWei], 0);
 }
コード例 #6
0
        void CmdOp(LinkedListNode <MahjongMachineCmd> opCmdNode, MahjongMachineCmd mjOpCmd = null)
        {
            if (opCmdNode == null && mjOpCmd == null)
            {
                return;
            }

            MahjongMachineCmd opCmd = mjOpCmd;

            if (opCmdNode != null)
            {
                opCmd = opCmdNode.Value;

                if (opCmd.isBlock)
                {
                    blockCmdCount++;
                }
            }

            if (opCmd.delayOpCmdLinkedList != null && opCmd.delayOpCmdLinkedList.Count > 0)
            {
                for (LinkedListNode <MahjongMachineCmd> node = opCmd.delayOpCmdLinkedList.First; node != null; node = opCmd.delayOpCmdLinkedList.First)
                {
                    opCmd.delayOpCmdLinkedList.RemoveFirst();
                    AppendCmdToDelayCmdList(node);
                }

                opCmd.delayOpCmdLinkedList.Clear();
            }

            switch (opCmd.opCode)
            {
            case MahjongOpCode.PlayEffectAudio:
            {
                PlayEffectAudioOpCmd cmd = (PlayEffectAudioOpCmd)opCmd;
                mjMachine.PlayEffectAudio(cmd.audioIdx, cmd.numIdx);
                RemoveCommonActionOpCmd(opCmdNode);
            }
            break;

            case MahjongOpCode.XiPai:
            {
                XiPaiCmd cmd = (XiPaiCmd)opCmd;
                mjMachine.XiPai(cmd.dealerSeatIdx, cmd.fengWei, opCmdNode);
            }
            break;


            case MahjongOpCode.FaPai:
            {
                FaPaiCmd cmd = (FaPaiCmd)opCmd;
                mjMachine.FaPai(cmd.startPaiIdx, cmd.mjHandSelfPaiFaceValueList, cmd.selfHuaList, cmd.selfBuPaiList, opCmdNode);
            }
            break;

            case MahjongOpCode.TurnNextPlayer:
            {
                TurnNextPlayerOpCmd cmd = (TurnNextPlayerOpCmd)opCmd;

                FengWei fw = mjMachine.GetSeatFengWei(cmd.turnToPlayerSeatIdx);
                mjMachine.diceMachine.OnFengWei(fw);
                mjMachine.diceMachine.SetLimitTime(cmd.time);
                mjMachine.diceMachine.StartTime();
                RemoveCommonActionOpCmd(opCmdNode);
            }
            break;

            case MahjongOpCode.ShowScore:
            {
                ShowScoreCmd cmd = (ShowScoreCmd)opCmd;
                mjMachine.uiScore.Show(cmd.seatScores);
                RemoveCommonActionOpCmd(opCmdNode);
            }
            break;

            case MahjongOpCode.HideSwapPaiUI:
            {
                mjMachine.uiSelectSwapHandPai.CompleteSwapPaiSelected();
                RemoveCommonActionOpCmd(opCmdNode);
            }
            break;

            case MahjongOpCode.QueMen:
            {
                QueMenCmd cmd = (QueMenCmd)opCmd;
                mjMachine.uiSelectQueMen.AppendPlayQueMenForSeatToList(cmd.seatIdx, cmd.queMenHuaSe);
                RemoveCommonActionOpCmd(opCmdNode);
            }
            break;


            case MahjongOpCode.ReqSelectSwapPai:
            {
                mjMachine.SelectSwapPai(opCmdNode);
            }
            break;

            case MahjongOpCode.ReqSelectQueMen:
            {
                ReqSelectQueMenOpCmd cmd = (ReqSelectQueMenOpCmd)opCmd;
                mjMachine.SelectQueMen(cmd.defaultQueMenHuaSe, opCmdNode);
            }
            break;

            case MahjongOpCode.ReqSelectDaPai:
            {
                ReqSelectDaPaiOpCmd cmd = (ReqSelectDaPaiOpCmd)opCmd;

                mjMachine.SelectDaPai(
                    cmd.huPaiInHandPaiIdxs, cmd.huPaiInfosInHandPai,
                    cmd.huPaiInMoPaiIdxs, cmd.huPaiInfosInMoPai, opCmdNode);
            }
            break;

            case MahjongOpCode.ReqSelectPCGTHPai:
            {
                ReqSelectPCGTHPaiOpCmd cmd = (ReqSelectPCGTHPaiOpCmd)opCmd;

                mjMachine.SelectPCGTHPai(cmd.pcgthBtnTypes,
                                         cmd.chiPaiMjValueList, cmd.tingPaiInHandPaiIdxs,
                                         cmd.tingPaiInfosInHandPai, cmd.tingPaiInMoPaiIdxs, cmd.tingPaiInfosInMoPai, opCmdNode);
            }
            break;

            case MahjongOpCode.QiDongDiceMachine:
            {
                QiDongDiceMachineCmd cmd = (QiDongDiceMachineCmd)opCmd;
                mjMachine.QiDongDiceMachine(cmd.seatIdx, cmd.dice1Point, cmd.dice2Point, opCmdNode);
            }
            break;

            case MahjongOpCode.ShowSwapPaiHint:
            {
                ShowSwapPaiHintCmd cmd = (ShowSwapPaiHintCmd)opCmd;
                mjMachine.ShowSwapPaiHint(cmd.swapPaiDirection);
                RemoveCommonActionOpCmd(opCmdNode);
            }
            break;

            case MahjongOpCode.SwapPai:
            {
                MahjongSwapPaiCmd cmd = (MahjongSwapPaiCmd)opCmd;
                mjMachine.SwapPai(
                    cmd.fromSeatIdx, cmd.toSeatIdx, cmd.swapMjCount,
                    cmd.toSeatHandPaiIdx,
                    cmd.mjFaceValues, cmd.fromSeatHandPaiIdx,
                    cmd.mjMoPaiFaceValues, cmd.fromSeatMoPaiIdx,
                    cmd.isShowBack, cmd.swapDir, opCmdNode);
            }
            break;



            case MahjongOpCode.MoPai:
            {
                MahjongMoPaiOpCmd cmd = (MahjongMoPaiOpCmd)opCmd;
                mjMachine.MoPai(cmd.seatIdx, cmd.mjFaceValue, opCmdNode);
            }
            break;

            case MahjongOpCode.DaPai:
            {
                MahjongDaPaiOpCmd cmd = (MahjongDaPaiOpCmd)opCmd;
                ActionCombineNum  actionCombineNum = mjMachine.GetRandomHandDaPaiActionNumForNextDeskMjPos(cmd.seatIdx);
                mjMachine.DaPai(cmd.seatIdx, cmd.handStyle, cmd.paiIdx, cmd.paiType, cmd.mjFaceValue, cmd.isJiaoTing, actionCombineNum, opCmdNode);
            }
            break;

            case MahjongOpCode.ChaPai:
            {
                MahjongChaPaiOpCmd cmd = (MahjongChaPaiOpCmd)opCmd;
                mjMachine.ChaPai(cmd.seatIdx, cmd.handStyle, cmd.orgPaiIdx, cmd.dstHandPaiIdx, cmd.orgPaiType, cmd.adjustDirection, opCmdNode);
            }
            break;

            case MahjongOpCode.SortPai:
            {
                MahjongPaiOpCmd cmd = (MahjongPaiOpCmd)opCmd;
                mjMachine.SortPai(cmd.seatIdx, SortPaiType.LEFT, opCmdNode);
            }
            break;

            case MahjongOpCode.BuHuaPai:
            {
                MahjongBuHuaPaiOpCmd cmd = (MahjongBuHuaPaiOpCmd)opCmd;
                mjMachine.BuHua(cmd.seatIdx, cmd.handStyle, cmd.buHuaPaiFaceValue, ActionCombineNum.HuPai, opCmdNode);
            }
            break;

            case MahjongOpCode.HuPai:
            {
                MahjongHuPaiOpCmd cmd = (MahjongHuPaiOpCmd)opCmd;
                mjMachine.HuPai(cmd.seatIdx, cmd.handStyle, cmd.huTargetSeatIdx, cmd.huTargetMjIdx, cmd.huPaiFaceValue, ActionCombineNum.HuPai, opCmdNode);
            }
            break;

            case MahjongOpCode.PengChiGangPai:
            {
                MahjongPcgPaiOpCmd cmd = (MahjongPcgPaiOpCmd)opCmd;
                mjMachine.PengChiGangPai(
                    cmd.seatIdx, cmd.handStyle, cmd.isMoveHand, cmd.moveHandDist,
                    cmd.faceValues, cmd.pcgType, cmd.pcgTargetSeatIdx, cmd.pcgTargetMjIdx, cmd.fengRainEffectEtcType,
                    ActionCombineNum.PengPai, opCmdNode);
            }
            break;

            case MahjongOpCode.TuiDaoPai:
            {
                MahjongTuiDaoPaiOpCmd cmd = (MahjongTuiDaoPaiOpCmd)opCmd;
                mjMachine.TuiDaoPai(cmd.seatIdx, cmd.handStyle, cmd.handPaiValueList, ActionCombineNum.TuiDaoPai, opCmdNode);
            }
            break;
            }
        }
コード例 #7
0
 public void SetXiPaiData(int dealerSeatIdx, FengWei fengWei, LinkedListNode <MahjongMachineCmd> opCmdNode = null)
 {
     this.dealerSeatIdx = dealerSeatIdx;
     this.fengWei       = fengWei;
     this.opCmdNode     = opCmdNode;
 }