/// <summary>
    /// Triggers the Game Over State
    /// </summary>
    private void TriggerLevelFailed()
    {
        //Set it to be nobody's turn
        CurrentTurn = GameTurn.TURN_NONE;

        //Send Level Failed Event
        LevelFailed?.Invoke();
    }
Пример #2
0
    /// <summary>
    /// Change the current level state
    /// </summary>
    /// <param name="state"></param>
    protected virtual void ChangeLevelState(LevelState newState)
    {
        if (CurrentLevelState == newState)
        {
            return;
        }

        LevelState oldState = CurrentLevelState;

        CurrentLevelState = newState;
        LevelStateChanged?.Invoke(oldState, newState);

        switch (newState)
        {
        case LevelState.Complete:
            LevelStats.time = LevelTime - TimeLeft;
            LevelComplete?.Invoke();
            break;

        case LevelState.Failed:
            LevelFailed?.Invoke();
            break;
        }
    }
 /// <summary>
 /// Triggers actions to end the current game with a fail state
 /// </summary>
 private void TriggerLevelFailed()
 {
     //Fire Event to end game
     LevelFailed?.Invoke();
 }
 public static void CallLevelFailed()
 {
     LevelFailed?.Invoke();
 }