Ejemplo n.º 1
0
        public void OnHandScore(MsgHandOver msg)
        {
            if (MyOwner.IsPlaying)
            {
                MyOwner.IsPlaying = false;
                MyOwner.AppendLog("[end]\r\n");
                var handoverType = msg.endType;
                switch (handoverType)
                {
                case (int)HandOverType.enumHandOverType_None:
                    MyOwner.AppendLog("流局\r\n");
                    break;

                case (int)HandOverType.enumHandOverType_Win_SelfDrawn:
                    MyOwner.AppendLog("自摸胡牌\r\n");
                    break;

                case (int)HandOverType.enumHandOverType_Win_Chuck:
                    MyOwner.AppendLog("放铳胡牌\r\n");
                    break;
                }
            }

            var handScore = msg.scores;

            if (handScore == null)
            {
                return;
            }

            var myScore = handScore.playerScores.FirstOrDefault(playerScore => playerScore.targetChairID == MyPlayer.ChairId);

            if (myScore == null)
            {
                return;
            }


            TbScore.Text = myScore.score.ToString();

            if (MyOwner.IsFirstPlayer(MyPlayer))
            {
                var scoreMsg = FormatScore(msg);
                MyOwner.ShowScoreWnd(scoreMsg);
            }
        }
Ejemplo n.º 2
0
        public void OnHandScore(MsgHandOver msg)
        {
            if (MyOwner.IsPlaying)
            {
                MyOwner.IsPlaying = false;
                MyOwner.AppendLog("[end]\r\n");
                var handoverType = msg.EndType;
                switch (handoverType)
                {
                case (int)HandOverType.EnumHandOverTypeNone:
                    MyOwner.AppendLog("平局\r\n");
                    break;

                case (int)HandOverType.EnumHandOverTypeWin:
                    MyOwner.AppendLog("赢牌\r\n");
                    break;

                case (int)HandOverType.EnumHandOverTypeLoss:
                    MyOwner.AppendLog("输牌\r\n");
                    break;
                }
            }

            var handScore = msg.Scores;

            if (handScore == null)
            {
                return;
            }

            var myScore = handScore.PlayerScores.FirstOrDefault(playerScore => playerScore.TargetChairID == MyPlayer.ChairId);

            if (myScore == null)
            {
                return;
            }


            TbScore.Text = myScore.TotalScore.ToString();

            if (MyOwner.IsFirstPlayer(MyPlayer))
            {
                var scoreMsg = FormatScore(msg);
                MyOwner.ShowScoreWnd(scoreMsg);
            }
        }