Beispiel #1
0
        public void InitUserGameState(ISFSObject data)
        {
            var       gdata          = App.GetGameData <SssGameData>();
            int       seat           = data.GetInt("seat");
            SssPlayer panel          = gdata.GetPlayer <SssPlayer>(seat, true);
            bool      selfReadyState = data.ContainsKey("state") && data.GetBool("state");

            panel.SetReadyStatue(selfReadyState);


            if (data.ContainsKey("isput"))
            {
                Dealer.FaPai(panel);  //为玩家创建13张手牌
                int isput = data.GetInt("isput");
                if (isput > 0)
                {
                    panel.MoveHandCardNoAnim();
                }
                else
                {
                    //播放等待动画
                    panel.RepositionCards();
                    panel.Waitting();
                }
            }
            //比牌阶段,所有人直接显示所有手牌
            else if (data.ContainsKey("playerinfo"))
            {
                var matchInfo = GetMatchInfoOnInitUserGameState(data);

                Dealer.FaPai(panel);
                panel.MoveHandCardNoAnim();
                panel.ShowAllHandPoker(matchInfo);
                if (matchInfo.Special > (int)CardType.none)
                {
                    panel.HandCardsType.SetSpecialMarkActive(true);
                    panel.HandCardsType.ShowTotalScore(matchInfo.TtScore);
                }
                else
                {
                    panel.GetGameInfoInitUser(matchInfo);
                }
            }


            //自己会有手牌,是选牌阶段
            if (data.ContainsKey("cards"))
            {
                if (data.ContainsKey("isput") && data.GetInt("isput") == 0)
                {
                    ChoiseMgr.ShowChoiseView(data);
                }
            }

            //比牌阶段初始化
            if (data.ContainsKey("userscore"))
            {
                TurnRes.InitTurnResultInfo(data.GetSFSObject("userscore"));
                TurnRes.ShowAllResultItem();
            }

            if (data.ContainsKey("score"))
            {
                int score = data.GetInt("score");

                if (score > 0)
                {
                    ResultMgr.WinSeats.Add(seat);
                    panel.ShowResultLabel(score);
                }
                else if (score < 0)
                {
                    ResultMgr.LoseSeats.Add(seat);
                    panel.ShowResultLabel(score);
                }
            }
        }
Beispiel #2
0
        public void InitUserGameState(ISFSObject data)
        {
            var gdata = App.GetGameData <SssGameData>();

            if (data.ContainsKey("isput"))
            {
                SssPlayer user = gdata.GetPlayer <SssPlayer>(data.GetInt("seat"), true);
                Dealer.FaPai(user);  //为玩家创建13张手牌
                int isput = data.GetInt("isput");
                if (isput > 0)
                {
                    user.MoveHandCardNoAnim();
                }
                else
                {
                    //播放等待动画
                    user.RepositionCards();
                    user.Waitting();
                }
            }

            //比牌阶段,所有人直接显示所有手牌
            else if (data.ContainsKey("duns"))
            {
                SssPlayer user = gdata.GetPlayer <SssPlayer>(data.GetInt("seat"), true);
                Dealer.FaPai(user);
                user.MoveHandCardNoAnim();
                ISFSObject duns         = data.GetSFSObject("duns");
                ISFSArray  dunsInfo     = duns.GetSFSArray("duninfo");
                var        cardsValList = dunsInfo.Cast <ISFSObject>().SelectMany(dun => dun.GetIntArray("cards")).ToList();
                user.ShowAllHandPoker(cardsValList);
            }


            //自己会有手牌,是选牌阶段
            if (data.ContainsKey("cards"))
            {
                if (data.ContainsKey("isput") && data.GetInt("isput") == 0)
                {
                    ChoiseMgr.ShowChoiseView(data);
                }
            }

            //比牌阶段初始化
            if (data.ContainsKey("userscore"))
            {
                TurnRes.InitTurnResultInfo(data.GetSFSObject("userscore"));
                TurnRes.ShowAllResultItem();
            }

            if (data.ContainsKey("score"))
            {
                int seat  = data.GetInt("seat");
                int score = data.GetInt("score");

                if (score > 0)
                {
                    ResultMgr.WinSeats.Add(seat);
                    gdata.GetPlayer <SssPlayer>(seat, true).ShowResultLabel(score);
                }
                else if (score < 0)
                {
                    ResultMgr.LoseSeats.Add(seat);
                    gdata.GetPlayer <SssPlayer>(seat, true).ShowResultLabel(score);
                }
            }
        }