Exemplo n.º 1
0
    /// <summary>
    /// Set state game
    /// </summary>
    /// <param name="state">State sẽ active</param>
    public static void ActiveState(EGameState state)
    {
        model._currentState = state;
        Debug.Log("Game State = " + state.ToString());
        switch (state)
        {
        case EGameState.deal:
            game.StartCoroutine(model._CreateObjects());
            break;

        case EGameState.finalizing:
            game.StartCoroutine(model._FinishGame());
            break;

        case EGameState.waitingForReady:
        case EGameState.waitingForPlayer:
            if (GameModelChan.YourController != null && GameModelChan.YourController.PlayerState == EPlayerController.EPlayerState.waiting)
            {
                game.OnClickReady(null);
            }
            GameModelChan.game.ClickStartGame = false;
            break;

        case EGameState.playing:
            MiniState = EGameStateMini.discard;     //For Update Button
            break;

        case EGameState.playerFullLaying:
            MiniState = EGameStateMini.player_full_laying;
            break;
        }
    }
Exemplo n.º 2
0
 private void SwitchState(EGameState state)
 {
     mStates[mGameState].OnExit();
     mGameState = state;
     mStates[mGameState].OnEnter();
     Debug.Log("Switched to state " + state.ToString());
 }
Exemplo n.º 3
0
        private string GetPlayText(EGameState state)
        {
            switch (state)
            {
            case EGameState.PlayTurn: return("Play");
            }

            return(state.ToString());
        }
Exemplo n.º 4
0
    /// <summary>
    /// Set state game
    /// </summary>
    /// <param name="state">State sẽ active</param>
    public static void ActiveState(EGameState state)
    {
        model._currentState = state;
        Debug.Log("Game State = " + state.ToString());
        if (state.ToString() == "deal")
        {
            HeaderMenu.Instance.isClickedBtnBack = true; // đang chia bài không cho Back ra
        }
        else
        {
            HeaderMenu.Instance.isClickedBtnBack = false;
        }
        switch (state)
        {
        case EGameState.deal:
            game.StartCoroutine(model._CreateObjects());
            break;

        case EGameState.finalizing:
            game.StartCoroutine(model._FinishGame());
            break;

        case EGameState.waitingForReady:
        case EGameState.waitingForPlayer:
            if (GameModelTLMN.YourController != null && GameModelTLMN.YourController.PlayerState == PlayerControllerTLMN.EPlayerState.waiting)
            {
                game.OnClickReady(null);
            }
            GameModelTLMN.game.ClickStartGame = false;
            break;

        case EGameState.playing:
            MiniState = EGameStateMini.discard;     //For Update Button
            break;
        }
    }