Index: source/network/FSM.h =================================================================== --- source/network/FSM.h +++ source/network/FSM.h @@ -19,7 +19,6 @@ #define FSM_H #include -#include #include @@ -41,8 +40,6 @@ } }; -using StateSet = std::set; - /** * Represents a signal in the state machine that a change has occurred. * The CFsmEvent objects are under the control of CFsm so @@ -101,12 +98,6 @@ */ void Shutdown(); - /** - * Adds the specified state to the internal list of states. - * @note If a state with the specified ID exists, the state is not added. - */ - void AddState(unsigned int state); - /** * Adds a new transistion to the state machine. */ @@ -137,22 +128,12 @@ return m_NextState; } - const StateSet& GetStates() const - { - return m_States; - } - /** * Updates the FSM and retrieves next state. * @return whether the state was changed. */ bool Update(unsigned int eventType, void* pEventData); - /** - * Verifies whether the specified state is managed by the FSM. - */ - bool IsValidState(unsigned int state) const; - /** * Tests whether the state machine has finished its work. * @note This is state machine specific. @@ -200,7 +181,6 @@ unsigned int m_FirstState; unsigned int m_CurrState; unsigned int m_NextState; - StateSet m_States; TransitionMap m_Transitions; }; Index: source/network/FSM.cpp =================================================================== --- source/network/FSM.cpp +++ source/network/FSM.cpp @@ -50,7 +50,6 @@ void CFsm::Shutdown() { - m_States.clear(); m_Transitions.clear(); m_Done = false; @@ -59,20 +58,9 @@ m_NextState = FSM_INVALID_STATE; } -void CFsm::AddState(unsigned int state) -{ - m_States.insert(state); -} - void CFsm::AddTransition(unsigned int state, unsigned int eventType, unsigned int nextState, Action* pAction /* = nullptr */, void* pContext /* = nullptr*/) { - // Make sure we store the current state - AddState(state); - - // Make sure we store the next state - AddState(nextState); - m_Transitions.insert({TransitionKey{state, eventType}, Transition{{pAction, pContext}, nextState}}); } @@ -96,9 +84,6 @@ if (IsFirstTime()) m_CurrState = m_FirstState; - if (!IsValidState(m_CurrState)) - return false; - // Lookup transition auto transitionIterator = m_Transitions.find({m_CurrState, eventType}); if (transitionIterator == m_Transitions.end()) @@ -126,12 +111,3 @@ // By default the internal flag m_Done is tested return m_Done; } - -bool CFsm::IsValidState(unsigned int state) const -{ - StateSet::const_iterator it = m_States.find(state); - if (it == m_States.end()) - return false; - - return true; -} Index: source/network/NetServer.cpp =================================================================== --- source/network/NetServer.cpp +++ source/network/NetServer.cpp @@ -48,6 +48,7 @@ #include #endif +#include #include /**