Ejemplo n.º 1
0
        protected override async ETTask Run(ETModel.Session session, Actor_GamerPlayCard_Ntt message)
        {
            UI uiRoom = Game.Scene.GetComponent <UIComponent>().Get(LandUIType.LandRoom);
            LandRoomComponent room  = uiRoom.GetComponent <LandRoomComponent>();
            Gamer             gamer = room.GetGamer(message.UserID);

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

                //本地玩家清空选中牌 关闭出牌按钮
                if (gamer.UserID == LandRoomComponent.LocalGamer.UserID)
                {
                    LandInteractionComponent interaction = uiRoom.GetComponent <LandRoomComponent>().Interaction;
                    interaction.Clear();
                    interaction.EndPlay();
                }

                //出牌后更新玩家手牌
                HandCardsComponent handCards = gamer.GetComponent <HandCardsComponent>();
                Card[]             Tcards    = new Card[message.Cards.Count];
                for (int i = 0; i < message.Cards.Count; i++)
                {
                    Tcards[i] = message.Cards[i];
                }
                handCards.PopCards(Tcards);
            }

            await ETTask.CompletedTask;
        }
Ejemplo n.º 2
0
        protected override async ETTask Run(ETModel.Session session, Actor_GamerGrabLandlordSelect_Ntt message)
        {
            UI uiRoom = Game.Scene.GetComponent <UIComponent>().Get(LandUIType.LandRoom);
            LandRoomComponent room  = uiRoom.GetComponent <LandRoomComponent>();
            Gamer             gamer = room.GetGamer(message.UserID);

            if (gamer != null)
            {
                if (gamer.UserID == LandRoomComponent.LocalGamer.UserID)
                {
                    uiRoom.GetComponent <LandRoomComponent>().Interaction.EndGrab();
                }
                gamer.GetComponent <LandlordsGamerPanelComponent>().SetGrab(message.IsGrab);
            }

            await ETTask.CompletedTask;
        }
Ejemplo n.º 3
0
        protected override async ETTask Run(ETModel.Session session, Actor_GamerDontPlayCard_Ntt message)
        {
            UI uiRoom = Game.Scene.GetComponent <UIComponent>().Get(LandUIType.LandRoom);
            LandRoomComponent room  = uiRoom.GetComponent <LandRoomComponent>();
            Gamer             gamer = room.GetGamer(message.UserID);

            if (gamer != null)
            {
                if (gamer.UserID == LandRoomComponent.LocalGamer.UserID)
                {
                    uiRoom.GetComponent <LandRoomComponent>().Interaction.EndPlay();
                }
                gamer.GetComponent <HandCardsComponent>().ClearPlayCards();
                gamer.GetComponent <LandlordsGamerPanelComponent>().SetDiscard();
            }

            await ETTask.CompletedTask;
        }