// Copyright (C) 2017 Jérôme Leclercq // This file is part of the "Nazara Development Kit" // For conditions of distribution and use, see copyright notice in Prerequesites.hpp #pragma once #ifndef NDK_STATEMACHINE_HPP #define NDK_STATEMACHINE_HPP #include #include #include #include namespace Ndk { class StateMachine { public: inline StateMachine(std::shared_ptr originalState); StateMachine(const StateMachine&) = delete; inline StateMachine(StateMachine&& fsm) = default; inline ~StateMachine(); inline void ChangeState(std::shared_ptr state); inline const std::shared_ptr& GetCurrentState() const; inline bool IsTopState(const State* state) const; inline std::shared_ptr PopState(); inline bool PopStatesUntil(std::shared_ptr state); inline void PushState(std::shared_ptr state); inline void SetState(std::shared_ptr state); inline bool Update(float elapsedTime); inline StateMachine& operator=(StateMachine&& fsm) = default; StateMachine& operator=(const StateMachine&) = delete; private: std::vector> m_states; }; } #include #endif // NDK_STATEMACHINE_HPP