Event.cpp 974 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-26
  6. * Changed: 2020-11-29
  7. *
  8. * */
  9. #include <ls_std/event/Event.hpp>
  10. ls_std::Event::Event(ls_std::event_id _id) : ls_std::Class("Event"),
  11. id(std::move(_id))
  12. {}
  13. void ls_std::Event::addParameter(const ls_std::event_parameter &_eventParameter)
  14. {
  15. if(!this->_hasParameter(_eventParameter.first)) {
  16. this->parameterList.insert(_eventParameter);
  17. }
  18. }
  19. ls_std::event_id ls_std::Event::getId()
  20. {
  21. return this->id;
  22. }
  23. ls_std::event_parameter_list ls_std::Event::getParameterList()
  24. {
  25. return this->parameterList;
  26. }
  27. void ls_std::Event::removeParameter(const ls_std::event_parameter_id &_id)
  28. {
  29. if(this->_hasParameter(_id)) {
  30. this->parameterList.erase(_id);
  31. }
  32. }
  33. bool ls_std::Event::_hasParameter(const ls_std::event_id &_id)
  34. {
  35. return this->parameterList.find(_id) != this->parameterList.end();
  36. }