예제 #1
0
    /// <summary>
    /// 玩家请求出牌
    /// </summary>
    private void onPlayerPlayCard()
    {
        List <Card> cardList = CharacterView.Player.FindSelectCard();
        CardType    cardType;

        Rulers.CanPop(cardList, out cardType);

        //!#@!#!@$!@#!@$!@%!@#
        //还需要根据上一次的出牌类型

        if (cardType != CardType.None)
        {
            //可以出牌
            PlayCardArgs e = new PlayCardArgs()
            {
                cardType      = cardType,
                characterType = CharacterType.Player,
                Length        = cardList.Count,
                Weight        = Tools.GetWeight(cardList, cardType)
            };
            dispatcher.Dispatch(CommandEvent.PlayCard, e);
        }
        else
        {
            UnityEngine.Debug.Log("请选择正确的牌");
        }
    }
예제 #2
0
    /// <summary>
    /// 请求玩家出牌事件的回调
    /// </summary>
    /// <param name="payload"></param>
    private void onPlayPayCard(IEvent payload)
    {
        List <Card> cardList = characterView.player.FindSelectCard();
        CardType    cardType;

        Rulers.CanPop(cardList, out cardType);
        //还需要根据上次出牌的类型



        if (cardType != CardType.None)
        {
            //可以出牌
            PlayCardArg e = new PlayCardArg(cardList.Count, Toos.GetWeight(cardList, cardType), CharacterType.Player, cardType);


            dispatcher.Dispatch(CommandEvent.PlayCard, e);
        }
        else
        {
            Debug.Log("请选择正确的牌");
        }
    }