コード例 #1
0
    } // Update del estado actual.

    public void Transition(T input)
    {
        FSMState <T> newState = _currentState.GetTransition(input);

        if (newState != null)
        {
            _currentState.Sleep();
            _currentState = newState;
            _currentState.Awake();
        }
    } // Añadir transicion de nuevo estado.
コード例 #2
0
    public void Transition(T input)
    {
        FSMState <T> newState = _currentState.GetTransition(input);

        if (newState == null)
        {
            return;
        }
        _currentState.Sleep();
        _currentState = newState;
        _currentState.Awake();
    }
コード例 #3
0
ファイル: FSM.cs プロジェクト: Ramax22/TP-1-IA-RamiroGarbagna
    //Funcion que se encargará de manejar las transiciones
    public void Transition(T input)
    {
        //Agarro el estado que deseo ejecutar
        FSMState <T> newState = _current.GetTransition(input);

        //En caso de que el estado exista en el diccionario, lo ejecuto y apago el actual
        if (newState != null)
        {
            _current.Sleep();
            _current = newState;
            _current.Awake();
        }
    }
コード例 #4
0
 public void SetInit(FSMState <T> init)
 {
     _currentState = init;
     _currentState.Awake();
 }
コード例 #5
0
    FSMState <T> _currentState; // Estado actual.

    public void SetInitState(FSMState <T> initState)
    {
        _currentState = initState;
        _currentState.Awake();
    } // Inicializar estado.
コード例 #6
0
ファイル: FSM.cs プロジェクト: Ramax22/TP-1-IA-RamiroGarbagna
 //Funcion donde declaro el initialState como _current y ejecuto su awake
 public void SetInitialState(FSMState <T> initialState)
 {
     _current = initialState;
     _current.Awake();
 }