Esempio n. 1
0
 void Transtion(e_combatState to)
 {
     if (CheckTranstion(to))
     {
         m_currentState = to;
     }
 }
Esempio n. 2
0
    bool CheckTranstion(e_combatState to)
    {
        switch(m_currentState)
        {
            case e_combatState.e_init:              // Init to <AnyState> is valid
                if( to != e_combatState.e_init)
                    return true;

                break;

            case e_combatState.e_actionSelect:
                if (to == e_combatState.e_action)
                    return true;

                break;

            case e_combatState.e_action:
                if ((to == e_combatState.e_resolve)
                  ||(to == e_combatState.e_endCombat))
                    return true;

                break;

            case e_combatState.e_resolve:
                if ((to == e_combatState.e_endCombat)
                  ||(to == e_combatState.e_actionSelect))
                    return true;

                break;

            case e_combatState.e_endCombat:
                if (to != e_combatState.e_init)
                    return true;

                break;
        }

        return false;
    }
Esempio n. 3
0
 //e_combatState m_nextState;
 // Use this for initialization
 void Start()
 {
     m_currentState = e_combatState.e_init;
 }