|
@@ -3,7 +3,7 @@
|
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2020-09-05
|
|
|
- * Changed: 2020-09-05
|
|
|
+ * Changed: 2020-09-07
|
|
|
*
|
|
|
* */
|
|
|
|
|
@@ -11,6 +11,8 @@
|
|
|
#define LS_STD_STATE_MACHINE_HPP
|
|
|
|
|
|
#include <memory>
|
|
|
+#include <unordered_map>
|
|
|
+#include <string>
|
|
|
#include "../base/Class.hpp"
|
|
|
#include "State.hpp"
|
|
|
|
|
@@ -21,9 +23,16 @@ namespace ls_std {
|
|
|
StateMachine();
|
|
|
~StateMachine() = default;
|
|
|
|
|
|
+ bool addState(std::shared_ptr<State> _state);
|
|
|
+ bool proceed();
|
|
|
+ bool setStartState(const std::string& _id);
|
|
|
+
|
|
|
private:
|
|
|
|
|
|
std::shared_ptr<State> currentState {};
|
|
|
+ std::unordered_map<std::string, std::shared_ptr<State>> states {};
|
|
|
+
|
|
|
+ bool _stateExists(const std::string& _id);
|
|
|
};
|
|
|
}
|
|
|
|