public bool Equals(StateTransition <S> other)
    {
        if (ReferenceEquals(null, other))
        {
            return(false);
        }
        if (ReferenceEquals(this, other))
        {
            return(true);
        }

        return(mInitState.Equals(other.GetInitState()) && mEndState.Equals(other.GetEndState()));
    }
示例#2
0
    public void AddTransition(S init, S end, Callback c)
    {
        StateTransition <S> tr = new StateTransition <S>(init, end);

        if (mTransitions.ContainsKey(tr))
        {
            Debug.Log("[FSM] Transition: " + tr.GetInitState() + " - " + tr.GetEndState() + " exists already.");
            return;
        }

        mTransitions.Add(tr, c);

        Debug.Log("[FSM] Added transition " + mTransitions.Count + ": " + tr.GetInitState() + " - " + tr.GetEndState()
                  + ", Callback: " + c);
    }
示例#3
0
    public void AddTransition(S init, S end, Callback c)
    {
        StateTransition <S> tr = new StateTransition <S>(init, end);

        if (mTransitions.ContainsKey(tr))
        {
            Debug.Log("[FSM] Переход: " + tr.GetInitState() + " - " + tr.GetEndState() + " уже добавлен.");
            return;
        }

        mTransitions.Add(tr, c);

        Debug.Log("[FSM] Добавлен переход " + mTransitions.Count + ": " + tr.GetInitState() + " - " + tr.GetEndState()
                  + ", Callback: " + c);
    }