Exemplo n.º 1
0
        protected override void Run(Session session, M2C_AuthorityPlayCard message)
        {
            UI             uiRoom         = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIRoom);
            GamerComponent gamerComponent = uiRoom.GetComponent <GamerComponent>();
            Gamer          gamer          = gamerComponent.Get(message.UserID);

            if (gamer != null)
            {
                //重置玩家提示
                gamer.GetComponent <GamerUIComponent>().ResetPrompt();

                //当玩家为先手,清空出牌
                if (message.IsFirst)
                {
                    gamer.GetComponent <HandCardsComponent>().ClearPlayCards();
                }

                //显示出牌按钮
                if (gamer.UserID == gamerComponent.LocalGamer.UserID)
                {
                    UIInteractionComponent interaction = uiRoom.GetComponent <UIRoomComponent>().Interaction;
                    interaction.IsFirst = message.IsFirst;
                    interaction.StartPlay();
                }
            }
        }
Exemplo n.º 2
0
        public override void Dispose()
        {
            if (this.IsDisposed)
            {
                return;
            }

            base.Dispose();

            this.Matching    = false;
            this.interaction = null;
        }
Exemplo n.º 3
0
        protected override void Run(Session session, C2M_Trusteeship message)
        {
            UI             uiRoom         = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIRoom);
            GamerComponent gamerComponent = uiRoom.GetComponent <GamerComponent>();
            Gamer          gamer          = gamerComponent.Get(message.UserID);

            if (gamer.UserID == ClientComponent.Instance.LocalPlayer.UserID)
            {
                UIInteractionComponent interaction = uiRoom.GetComponent <UIRoomComponent>().Interaction;
                interaction.isTrusteeship = message.isTrusteeship;
            }
        }
Exemplo n.º 4
0
        protected override void Run(Session session, M2C_GamerPlayCard_Ntt message)
        {
            UI             uiRoom         = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIRoom);
            GamerComponent gamerComponent = uiRoom.GetComponent <GamerComponent>();
            Gamer          gamer          = gamerComponent.Get(message.UserID);

            if (gamer != null)
            {
                gamer.GetComponent <GamerUIComponent>().ResetPrompt();

                if (gamer.UserID == gamerComponent.LocalGamer.UserID)
                {
                    UIInteractionComponent interaction = uiRoom.GetComponent <UIRoomComponent>().Interaction;
                    interaction.Clear();
                    interaction.EndPlay();
                }

                HandCardsComponent handCards = gamer.GetComponent <HandCardsComponent>();
                handCards.PopCards(message.Cards);
            }
        }