示例#1
0
        //出牌请求
        public void RequestPlayCard(params object[] objs)
        {
            int thePlayCardType           = PlayCardType.None;
            RepeatedField <int> pithCards = _joyLandlordsHandComponent.GetPithCards();

            if (isFirstPlayCard)
            {
                thePlayCardType = JoyLdsGamePlayHandLogic.PlayerPlayHandIsRational(pithCards);
            }
            else
            {
                thePlayCardType = JoyLdsGamePlayHandLogic.PlayerPlayHandIsRational(UpPlayCardType, UpPlayCardArray, pithCards);
            }
            if (thePlayCardType != PlayCardType.None)
            {
                Actor_JoyLds_PlayCard actorJoyLdsPlayCard =
                    new Actor_JoyLds_PlayCard()
                {
                    Cards = pithCards, PlayCardType = thePlayCardType
                };
                SessionComponent.Instance.Send(actorJoyLdsPlayCard as IMessage);
            }
            else
            {
                _joyLdsUserPlayer.ShowSlectHandFoulTextGo();
            }
        }
        //玩家出牌
        public static void PlayCard(this JoyLdsRoom joyLdsRoom, int seatIndex, RepeatedField <int> cards)
        {
            int playCardType = 0;

            if (joyLdsRoom.CurrPlayCardType == PlayCardType.None)
            {
                playCardType = JoyLdsGamePlayHandLogic.PlayerPlayHandIsRational(cards);
            }
            else if (joyLdsRoom.CurrBeOperationSeatIndex == seatIndex)
            {
                playCardType = JoyLdsGamePlayHandLogic.PlayerPlayHandIsRational(joyLdsRoom.CurrPlayCardType, joyLdsRoom.CurrPlayCardCards, cards);
            }
            if (playCardType != PlayCardType.None)
            {
                joyLdsRoom.AttirmPlayCard(seatIndex, playCardType, cards);
            }
            else
            {
                Log.Info("玩家索引:" + seatIndex + "  出牌不合理");
            }
        }