DailyNewsAgency.cpp 845 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-27
  6. * Changed: 2022-05-20
  7. *
  8. * */
  9. #include "DailyNewsAgency.hpp"
  10. #include <ls_std/ls_std_event.hpp>
  11. ls_std_event_test::DailyNewsAgency::DailyNewsAgency() : ls_std_event_test::NewsAgency("DailyNewsAgency")
  12. {}
  13. void ls_std_event_test::DailyNewsAgency::listen(const ls::std::core::Class &_info)
  14. {
  15. ls::std::event::Event event = dynamic_cast<const ls::std::event::Event &>(_info);
  16. if (event.getId() == "SeriousNewsEvent")
  17. {
  18. this->news = this->getName() + ": " + event.getParameterList().at("news");
  19. }
  20. }
  21. void ls_std_event_test::DailyNewsAgency::clear()
  22. {
  23. this->news.clear();
  24. }
  25. ::std::string ls_std_event_test::DailyNewsAgency::getNews()
  26. {
  27. return this->news;
  28. }