コード例 #1
0
        public static ResultPlayerGiveUp CreateResultPlayerGiveUpMsg(string RoomCode, string giveUpOpenId, string nextOpenId)
        {
            ResultPlayerGiveUp msg = new ResultPlayerGiveUp(RoomCode);

            msg.GiveUpUserOpenId = giveUpOpenId;
            msg.NextUserOpenId   = nextOpenId;
            return(msg);
        }
コード例 #2
0
        public override List <IGameMessage> HandleData(GameUserSession session, dataPlayerGiveUp Data)
        {
            List <IGameMessage> msgList = new List <IGameMessage>();
            GameManager         gm      = session.GameManager;

            gm.PlayerGiveUp();

            var gi        = gm.PreNextStep(true);
            var dealCards = gm.DealCard(gi);

            if (dealCards != null)
            {
                ResultPlayerGiveUp giveUpMsg = GameMessageHandle.CreateResultPlayerGiveUpMsg(gm.RoomCode, Data.OpenId, "");
                msgList.Add(giveUpMsg);

                gi = gm.PreNextStep(true);
                var cardsMsg = GameMessageHandle.CreateDealCardMsg(gm.RoomCode, dealCards, gi);
                msgList.Add(cardsMsg);

                GameTaskManager.SyncTask_DealCardDone(session, gi);
            }
            else
            {
                var msg = gm.WaitNextPlayer(gi);
                if (msg != null)
                {
                    msgList.Add(msg);
                }
                else
                {
                    ResultPlayerGiveUp giveUpMsg = GameMessageHandle.CreateResultPlayerGiveUpMsg(gm.RoomCode, Data.OpenId, gi.CurBetUserOpenId);
                    msgList.Add(giveUpMsg);
                }
            }

            return(msgList);
        }