SDK/StateMachine: Add GetCurrentState function

Former-commit-id: 20b8c0d81deb5d5c6aafc1c8d4d261b046f260c3 [formerly 37762eaaf8bd7c0b2434b65dfc62d95d4ae2db15] [formerly 5606a74447be6048ce12a502722a75c726cbf9ef [formerly cc437974e34587cf7f63d8fb7f5447473826ee1c]]
Former-commit-id: 677c22d4ebcfa8bf22a85210712fea061dedc0da [formerly 3979a42d5a2ed3c2635ed654bf6f25b88c32a00e]
Former-commit-id: 0d31a924eead5ed4f384fcbdde6411054c3a9b27
This commit is contained in:
Lynix 2016-08-03 13:46:42 +02:00
parent a2fbd9f2d0
commit ee1bd866ab
2 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,8 @@ namespace Ndk
inline void ChangeState(std::shared_ptr<State> state); inline void ChangeState(std::shared_ptr<State> state);
inline const std::shared_ptr<State>& GetCurrentState() const;
inline bool Update(float elapsedTime); inline bool Update(float elapsedTime);
inline StateMachine& operator=(StateMachine&& fsm) = default; inline StateMachine& operator=(StateMachine&& fsm) = default;

View File

@ -26,6 +26,11 @@ namespace Ndk
m_nextState = std::move(state); m_nextState = std::move(state);
} }
inline const std::shared_ptr<State>& StateMachine::GetCurrentState() const
{
return m_currentState;
}
inline bool StateMachine::Update(float elapsedTime) inline bool StateMachine::Update(float elapsedTime)
{ {
if (m_nextState) if (m_nextState)