Ejemplo n.º 1
0
    /*动作*/


    //开始
    bool IMGameView.OnStart(OptionData.DataBase data)
    {
        //游戏开始
        gameStartFlag = true;
        //禁止界面操作
        globalOperateFlag = false;
        //当前状态
        previousState = Logic.add_group;
        //下一个状态
        nextState = Logic.turn_dice;
        //配置
        gameData = data;
        //发牌顺序
        SetPriority(gameData.player_priority);
        //重置
        gameAct.Reset();
        //随便连起链表便于洗牌
        gameAct.CardDirection(0);
        //洗牌 第一个出牌的总是庄家 庄家为0
        StartCoroutine(gameAct.AddGroup(() =>
        {
            //洗完牌摇色子
            StartCoroutine(LogicCprocessor(currentUserID));
        }));

        return(true);
    }
Ejemplo n.º 2
0
    IEnumerator GetTest(CardTest type, MahjongPrefab carditem = new MahjongPrefab())
    {
        switch (type)
        {
        case CardTest.group:
            yield return(GameAct.AddGroup());

            break;

        case CardTest.handCard:
            yield return(GameAct.AddHandCard(GameAct.hostUser, carditem));

            yield return(GameAct.DisplayCard(GameAct.hostUser));

            break;

        case CardTest.outCard:
            yield return(GameAct.AddOutCard(GameAct.hostUser, carditem));

            break;

        case CardTest.spacialCard:
            yield return(GameAct.AddSpacialCard(GameAct.hostUser, carditem));

            break;

        case CardTest.getCard:
            yield return(GameAct.AddHandleCard(GameAct.hostUser, carditem));

            break;

        case CardTest.insertCard:
            int index = GameAct.hostUser.handCard.Count;
            if (index < 3)
            {
                --index;
            }
            else
            {
                index = 2;
            }
            yield return(GameAct.InsertToHandCard(GameAct.hostUser, index, GameAct.hostUser.handleCard.GetMahjongCard()));

            break;

        case CardTest.diceRoll:
            yield return(GameAct.TurnDice(Random.Range(1, 7), Random.Range(1, 7)));

            break;

        case CardTest.displayDice:
            yield return(GameAct.DisapperDice());

            break;
        }
    }