StateMachine.cpp 589 B

123456789101112131415161718192021222324
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-05
  6. * Changed: 2020-09-07
  7. *
  8. * */
  9. #include "StateMachine.hpp"
  10. ls_std::StateMachine::StateMachine() : Class("StateMachine")
  11. {}
  12. bool ls_std::StateMachine::addState(std::shared_ptr<State> _state) {
  13. bool added {};
  14. this->states.insert({_state->getId(), std::move(_state)});
  15. return added;
  16. }
  17. bool ls_std::StateMachine::_stateExists(const std::string &_id) {
  18. return this->states.find(_id) != this->states.end();
  19. }