示例#1
0
        protected override void SwitchChooseTingState(params object[] args)
        {
            MahjongContainer item;
            List <int>       tingList = args[0] as List <int>;

            if (tingList == null || tingList.Count == 0)
            {
                return;
            }
            var list = PlayerHand.MahjongList;

            for (int i = 0; i < list.Count; i++)
            {
                item = list[i];
                item.ResetPos();
                if (!tingList.Contains(item.Value))
                {
                    item.Lock = true;
                    item.RemoveMahjongScript();
                }
                else
                {
                    item.SetMahjongScript();
                    item.SetThowOutCall(TingpaiClickEvent);
                }
            }
            UserContorl.ClearSelectCard();
        }
        public void LogicAction()
        {
            int currChair = DataCenter.CurrOpChair;

            Game.MahjongGroups.Do((groups) =>
            {
                groups.OnClearFlagMahjong();
                if (DataCenter.CurrOpChair == 0)
                {
                    UserContorl.ClearSelectCard();
                }
                groups.MahjongHandWall[currChair].ThrowOut(mData.ThrowoutCard);
                var item = groups.MahjongThrow[currChair].GetInMahjong(mData.ThrowoutCard);
                Game.TableManager.ShowOutcardFlag(item);
            });
            MahjongUtility.PlayMahjongSound(currChair, mData.ThrowoutCard);

            //金币房时 玩家选择听牌时,如果时间到了系统自动出牌, 恢复为正常出牌状态
            if (DataCenter.Room.RoomType == MahRoomType.YuLe)
            {
                var playerHand = Game.MahjongGroups.PlayerHand.GetMahHandComponent <MahPlayerHand>();
                if (playerHand.CurrState == HandcardStateTyps.ChooseNiuTing || playerHand.CurrState == HandcardStateTyps.ChooseTingCard)
                {
                    playerHand.SetHandCardState(HandcardStateTyps.Normal);
                }
            }
        }
示例#3
0
        /// <summary>
        /// 手牌恢复未抬起状态
        /// </summary>
        public void HandCardsResetPos()
        {
            MahjongContainer item;

            UserContorl.ClearSelectCard();
            for (int i = 0; i < mMahjongList.Count; i++)
            {
                item = mMahjongList[i];
                item.ResetPos();
            }
        }
示例#4
0
        /// <summary>
        /// 冻结手牌,手牌不能进行何操作
        /// </summary>
        public void SwitchFreezeState()
        {
            MahjongContainer item;
            var list = PlayerHand.MahjongList;

            for (int i = 0; i < list.Count; i++)
            {
                item      = list[i];
                item.Lock = true;
                item.ResetPos();
                item.RemoveMahjongScript();
            }
            UserContorl.ClearSelectCard();
        }
示例#5
0
        protected virtual void SwitchNormalState()
        {
            MahjongContainer item = null;
            var list = PlayerHand.MahjongList;

            for (int i = 0; i < list.Count; i++)
            {
                item      = list[i];
                item.Lock = false;
                item.SetMahjongScript();
                item.SetAllowOffsetStatus(true);
                item.SetThowOutCall(ThrowCardClickEvent);
                item.ResetPos();
            }
            UserContorl.ClearSelectCard();
        }
示例#6
0
        /// <summary>
        /// 切换为选换牌状态
        /// </summary>
        private void SwitchSelectCardsState()
        {
            MahjongContainer item = null;

            UserContorl.ClearSelectCard();
            var list = PlayerHand.MahjongList;

            for (int i = 0; i < list.Count; i++)
            {
                item = list[i];
                item.SetAllowOffsetStatus(false);
                item.SetThowOutCall(SwitchCardsClickEvent);
                item.Lock = false;
                //屏蔽牌的select事件
                item.SetSelectFlag(true);
                item.ResetPos();
            }
        }
示例#7
0
        protected void SwitchChooseNiuTingState(params object[] args)
        {
            List <int> tingList = args[0] as List <int>;

            if (tingList == null || tingList.Count == 0)
            {
                return;
            }
            MahjongContainer item;

            UserContorl.ClearSelectCard();
            var list = PlayerHand.MahjongList;

            for (int i = 0; i < list.Count; i++)
            {
                item = list[i];
                item.ResetPos();
                if (!tingList.Contains(item.Value))
                {
                    item.Lock = true;
                    item.RemoveMahjongScript();
                }
            }
            for (int i = 0; i < tingList.Count; i++)
            {
                for (int j = 0; j < list.Count; j++)
                {
                    item = list[j];
                    if (item.Value == tingList[i])
                    {
                        item.SetMahjongScript();
                        item.SetThowOutCall(NiuTingClickEvent);
                    }
                }
            }
        }
示例#8
0
 public override void SortHandMahjong()
 {
     base.SortHandMahjong();
     UserContorl.ClearSelectCard();
 }